home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Icon 8.1 / msm-1 / rtt.sit / rttmain.c < prev    next >
MacBinary  |  1992-09-19  |  12.6 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: rttmain.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sat Sep 19 16:48:14 1992, modified Sat Sep 19 16:48:14 1992, creator 'MPS ', type ASCII, 12185 bytes "rttmain.c" , at 0x3019 428 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 72 74 74 6d 61 69 | 6e 2e 63 00 00 00 00 00 |..rttmai|n.c.....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 2f 99 00 | 00 01 ac a6 e1 42 8e a6 |...../..|.....B..|
|00000060| e1 42 8e 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.B......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 1d 84 00 00 |........|........|
|00000080| 23 69 6e 63 6c 75 64 65 | 20 22 72 74 74 2e 68 22 |#include| "rtt.h"|
|00000090| 0d 0d 2f 2a 0d 20 2a 20 | 70 72 6f 74 6f 74 79 70 |../*. * |prototyp|
|000000a0| 65 73 20 66 6f 72 20 73 | 74 61 74 69 63 20 66 75 |es for s|tatic fu|
|000000b0| 6e 63 74 69 6f 6e 73 2e | 0d 20 2a 2f 0d 68 69 64 |nctions.|. */.hid|
|000000c0| 64 65 6e 20 6e 6f 76 61 | 6c 75 65 20 61 64 64 5f |den nova|lue add_|
|000000d0| 74 64 65 66 20 50 61 72 | 61 6d 73 28 28 63 68 61 |tdef Par|ams((cha|
|000000e0| 72 20 2a 6e 61 6d 65 29 | 29 3b 0d 0d 2f 2a 0d 20 |r *name)|);../*. |
|000000f0| 2a 20 72 65 66 70 61 74 | 68 20 69 73 20 75 73 65 |* refpat|h is use|
|00000100| 64 20 74 6f 20 6c 6f 63 | 61 74 65 20 74 68 65 20 |d to loc|ate the |
|00000110| 73 74 61 6e 64 61 72 64 | 20 69 6e 63 6c 75 64 65 |standard| include|
|00000120| 20 66 69 6c 65 73 20 66 | 6f 72 20 74 68 65 20 49 | files f|or the I|
|00000130| 63 6f 6e 2e 0d 20 2a 20 | 20 72 75 6e 2d 74 69 6d |con.. * | run-tim|
|00000140| 65 20 73 79 73 74 65 6d | 2e 20 49 66 20 70 61 74 |e system|. If pat|
|00000150| 63 68 70 61 74 68 20 68 | 61 73 20 62 65 65 6e 20 |chpath h|as been |
|00000160| 70 61 74 63 68 65 64 20 | 69 6e 20 74 68 65 20 62 |patched |in the b|
|00000170| 69 6e 61 72 79 20 6f 66 | 20 72 74 74 2c 0d 20 2a |inary of| rtt,. *|
|00000180| 20 20 74 68 65 20 73 74 | 72 69 6e 67 20 77 61 73 | the st|ring was|
|00000190| 20 70 61 74 63 68 65 64 | 20 69 6e 20 69 73 20 75 | patched| in is u|
|000001a0| 73 65 64 20 66 6f 72 20 | 72 65 66 70 61 74 68 2e |sed for |refpath.|
|000001b0| 0d 20 2a 2f 0d 63 68 61 | 72 20 70 61 74 63 68 70 |. */.cha|r patchp|
|000001c0| 61 74 68 5b 4d 61 78 50 | 61 74 68 2b 31 38 5d 20 |ath[MaxP|ath+18] |
|000001d0| 3d 20 22 25 50 61 74 63 | 68 53 74 72 69 6e 67 48 |= "%Patc|hStringH|
|000001e0| 65 72 65 2d 3e 22 3b 0d | 0d 2f 2a 0d 20 2a 20 54 |ere->";.|./*. * T|
|000001f0| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 63 6f 64 |he follo|wing cod|
|00000200| 65 20 69 73 20 6f 70 65 | 72 61 74 69 6e 67 2d 73 |e is ope|rating-s|
|00000210| 79 73 74 65 6d 20 64 65 | 70 65 6e 64 65 6e 74 20 |ystem de|pendent |
|00000220| 5b 40 72 74 74 6d 61 69 | 6e 2e 30 31 5d 2e 20 20 |[@rttmai|n.01]. |
|00000230| 44 65 66 69 6e 69 74 69 | 6f 6e 0d 20 2a 20 20 6f |Definiti|on. * o|
|00000240| 66 20 72 65 66 70 61 74 | 68 2e 0d 20 2a 2f 0d 0d |f refpat|h.. */..|
|00000250| 23 69 66 20 50 4f 52 54 | 0d 20 20 20 2f 2a 20 73 |#if PORT|. /* s|
|00000260| 6f 6d 65 74 68 69 6e 67 | 20 69 73 20 6e 65 65 64 |omething| is need|
|00000270| 65 64 20 2a 2f 0d 44 65 | 6c 69 62 65 72 61 74 65 |ed */.De|liberate|
|00000280| 20 53 79 6e 74 61 78 20 | 45 72 72 6f 72 0d 23 65 | Syntax |Error.#e|
|00000290| 6e 64 69 66 09 09 09 09 | 09 2f 2a 20 50 4f 52 54 |ndif....|./* PORT|
|000002a0| 20 2a 2f 0d 0d 23 69 66 | 20 55 4e 49 58 20 7c 7c | */..#if| UNIX |||
|000002b0| 20 41 4d 49 47 41 20 7c | 7c 20 41 54 41 52 49 5f | AMIGA ||| ATARI_|
|000002c0| 53 54 20 7c 7c 20 4d 41 | 43 49 4e 54 4f 53 48 20 |ST || MA|CINTOSH |
|000002d0| 7c 7c 20 4d 53 44 4f 53 | 20 7c 7c 20 4d 56 53 20 ||| MSDOS| || MVS |
|000002e0| 7c 7c 20 4f 53 32 20 7c | 7c 20 56 4d 0d 63 68 61 ||| OS2 ||| VM.cha|
|000002f0| 72 20 2a 72 65 66 70 61 | 74 68 20 3d 20 52 65 66 |r *refpa|th = Ref|
|00000300| 50 61 74 68 3b 0d 23 65 | 6e 64 69 66 09 09 09 09 |Path;.#e|ndif....|
|00000310| 09 2f 2a 20 55 4e 49 58 | 20 2e 2e 2e 20 2a 2f 0d |./* UNIX| ... */.|
|00000320| 0d 23 69 66 20 56 4d 53 | 0d 63 68 61 72 20 2a 72 |.#if VMS|.char *r|
|00000330| 65 66 70 61 74 68 20 3d | 20 22 49 43 4f 4e 5f 42 |efpath =| "ICON_B|
|00000340| 49 4e 3a 22 3b 0d 23 65 | 6e 64 69 66 09 09 09 09 |IN:";.#e|ndif....|
|00000350| 09 2f 2a 20 56 4d 53 20 | 2a 2f 0d 0d 2f 2a 0d 20 |./* VMS |*/../*. |
|00000360| 2a 20 45 6e 64 20 6f 66 | 20 6f 70 65 72 61 74 69 |* End of| operati|
|00000370| 6e 67 2d 73 79 73 74 65 | 6d 20 73 70 65 63 69 66 |ng-syste|m specif|
|00000380| 69 63 20 63 6f 64 65 2e | 0d 20 2a 2f 0d 0d 0d 2f |ic code.|. */.../|
|00000390| 2a 0d 20 2a 20 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |*. * The| followi|
|000003a0| 6e 67 20 63 6f 64 65 20 | 69 73 20 6f 70 65 72 61 |ng code |is opera|
|000003b0| 74 69 6e 67 2d 73 79 73 | 74 65 6d 20 64 65 70 65 |ting-sys|tem depe|
|000003c0| 6e 64 65 6e 74 20 5b 40 | 72 74 74 6d 61 69 6e 2e |ndent [@|rttmain.|
|000003d0| 30 32 5d 2e 0d 20 2a 20 | 54 68 65 20 72 65 6c 61 |02].. * |The rela|
|000003e0| 74 69 76 65 20 70 61 74 | 68 20 74 6f 20 67 72 74 |tive pat|h to grt|
|000003f0| 74 69 6e 2e 68 20 61 6e | 64 20 72 74 2e 68 20 64 |tin.h an|d rt.h d|
|00000400| 65 70 65 6e 64 73 20 6f | 6e 20 77 68 65 74 68 65 |epends o|n whethe|
|00000410| 72 20 74 68 65 79 20 61 | 72 65 0d 20 2a 20 20 69 |r they a|re. * i|
|00000420| 6e 74 65 72 70 72 65 74 | 65 64 20 61 73 20 72 65 |nterpret|ed as re|
|00000430| 6c 61 74 69 76 65 20 74 | 6f 20 77 68 65 72 65 20 |lative t|o where |
|00000440| 72 74 74 2e 65 78 65 20 | 69 73 20 6f 72 20 77 68 |rtt.exe |is or wh|
|00000450| 65 72 65 20 72 74 74 2e | 65 78 65 20 69 73 0d 20 |ere rtt.|exe is. |
|00000460| 2a 20 20 69 6e 76 6f 6b | 65 64 2e 0d 20 2a 2f 0d |* invok|ed.. */.|
|00000470| 0d 23 69 66 20 50 4f 52 | 54 0d 20 20 20 2f 2a 20 |.#if POR|T. /* |
|00000480| 73 6f 6d 65 74 68 69 6e | 67 20 69 73 20 6e 65 65 |somethin|g is nee|
|00000490| 64 65 64 20 2a 2f 0d 44 | 65 6c 69 62 65 72 61 74 |ded */.D|eliberat|
|000004a0| 65 20 53 79 6e 74 61 78 | 20 45 72 72 6f 72 0d 23 |e Syntax| Error.#|
|000004b0| 65 6e 64 69 66 09 09 09 | 09 09 2f 2a 20 50 4f 52 |endif...|../* POR|
|000004c0| 54 20 2a 2f 0d 0d 23 69 | 66 20 41 54 41 52 49 5f |T */..#i|f ATARI_|
|000004d0| 53 54 20 7c 7c 20 4d 56 | 53 20 7c 7c 20 56 4d 0d |ST || MV|S || VM.|
|000004e0| 44 65 6c 69 62 65 72 61 | 74 65 20 53 79 6e 74 61 |Delibera|te Synta|
|000004f0| 78 20 45 72 72 6f 72 0d | 23 65 6e 64 69 66 09 09 |x Error.|#endif..|
|00000500| 09 09 09 2f 2a 20 55 4e | 49 58 20 2e 2e 2e 20 2a |.../* UN|IX ... *|
|00000510| 2f 0d 0d 23 69 66 20 41 | 4d 49 47 41 0d 63 68 61 |/..#if A|MIGA.cha|
|00000520| 72 20 2a 67 72 74 74 69 | 6e 5f 70 61 74 68 20 3d |r *grtti|n_path =|
|00000530| 20 22 2f 68 2f 67 72 74 | 74 69 6e 2e 68 22 3b 0d | "/h/grt|tin.h";.|
|00000540| 63 68 61 72 20 2a 72 74 | 5f 70 61 74 68 20 3d 20 |char *rt|_path = |
|00000550| 22 2f 68 2f 72 74 2e 68 | 22 3b 0d 23 65 6e 64 69 |"/h/rt.h|";.#endi|
|00000560| 66 09 09 09 09 09 2f 2a | 20 41 4d 49 47 41 20 2a |f...../*| AMIGA *|
|00000570| 2f 0d 0d 23 69 66 20 4d | 41 43 49 4e 54 4f 53 48 |/..#if M|ACINTOSH|
|00000580| 0d 63 68 61 72 20 2a 67 | 72 74 74 69 6e 5f 70 61 |.char *g|rttin_pa|
|00000590| 74 68 20 3d 20 22 3a 68 | 3a 67 72 74 74 69 6e 2e |th = ":h|:grttin.|
|000005a0| 68 22 3b 0d 63 68 61 72 | 20 2a 72 74 5f 70 61 74 |h";.char| *rt_pat|
|000005b0| 68 20 3d 20 22 3a 68 3a | 72 74 2e 68 22 3b 0d 23 |h = ":h:|rt.h";.#|
|000005c0| 65 6e 64 69 66 09 09 09 | 09 09 2f 2a 20 4d 41 43 |endif...|../* MAC|
|000005d0| 49 4e 54 4f 53 48 20 2a | 2f 0d 0d 23 69 66 20 4d |INTOSH *|/..#if M|
|000005e0| 53 44 4f 53 20 7c 7c 20 | 4f 53 32 0d 63 68 61 72 |SDOS || |OS2.char|
|000005f0| 20 2a 67 72 74 74 69 6e | 5f 70 61 74 68 20 3d 20 | *grttin|_path = |
|00000600| 22 2e 2e 5c 5c 68 5c 5c | 67 72 74 74 69 6e 2e 68 |"..\\h\\|grttin.h|
|00000610| 22 3b 0d 63 68 61 72 20 | 2a 72 74 5f 70 61 74 68 |";.char |*rt_path|
|00000620| 20 3d 20 22 2e 2e 5c 5c | 68 5c 5c 72 74 2e 68 22 | = "..\\|h\\rt.h"|
|00000630| 3b 0d 23 65 6e 64 69 66 | 09 09 09 09 09 2f 2a 20 |;.#endif|...../* |
|00000640| 4d 53 44 4f 53 20 7c 7c | 20 4f 53 32 20 2a 2f 0d |MSDOS ||| OS2 */.|
|00000650| 0d 23 69 66 20 56 4d 53 | 0d 63 68 61 72 20 2a 67 |.#if VMS|.char *g|
|00000660| 72 74 74 69 6e 5f 70 61 | 74 68 20 3d 20 22 67 72 |rttin_pa|th = "gr|
|00000670| 74 74 69 6e 2e 68 22 3b | 0d 63 68 61 72 20 2a 72 |ttin.h";|.char *r|
|00000680| 74 5f 70 61 74 68 20 3d | 20 22 72 74 2e 68 22 3b |t_path =| "rt.h";|
|00000690| 0d 23 65 6e 64 69 66 09 | 09 09 09 09 2f 2a 20 56 |.#endif.|..../* V|
|000006a0| 4d 53 20 2a 2f 0d 0d 23 | 69 66 20 55 4e 49 58 0d |MS */..#|if UNIX.|
|000006b0| 63 68 61 72 20 2a 67 72 | 74 74 69 6e 5f 70 61 74 |char *gr|ttin_pat|
|000006c0| 68 20 3d 20 22 2e 2e 2f | 73 72 63 2f 68 2f 67 72 |h = "../|src/h/gr|
|000006d0| 74 74 69 6e 2e 68 22 3b | 0d 63 68 61 72 20 2a 72 |ttin.h";|.char *r|
|000006e0| 74 5f 70 61 74 68 20 3d | 20 22 2e 2e 2f 73 72 63 |t_path =| "../src|
|000006f0| 2f 68 2f 72 74 2e 68 22 | 3b 0d 23 65 6e 64 69 66 |/h/rt.h"|;.#endif|
|00000700| 09 09 09 09 09 2f 2a 20 | 55 4e 49 58 20 2a 2f 0d |...../* |UNIX */.|
|00000710| 0d 2f 2a 0d 20 2a 20 45 | 6e 64 20 6f 66 20 6f 70 |./*. * E|nd of op|
|00000720| 65 72 61 74 69 6e 67 2d | 73 79 73 74 65 6d 20 73 |erating-|system s|
|00000730| 70 65 63 69 66 69 63 20 | 63 6f 64 65 2e 0d 20 2a |pecific |code.. *|
|00000740| 2f 0d 0d 73 74 61 74 69 | 63 20 63 68 61 72 20 2a |/..stati|c char *|
|00000750| 6f 73 74 72 20 3d 20 22 | 45 43 50 44 3a 49 3a 55 |ostr = "|ECPD:I:U|
|00000760| 3a 64 3a 63 69 72 3a 73 | 74 3a 78 22 3b 0d 73 74 |:d:cir:s|t:x";.st|
|00000770| 61 74 69 63 20 63 68 61 | 72 20 2a 6f 70 74 69 6f |atic cha|r *optio|
|00000780| 6e 73 20 3d 20 0d 20 20 | 20 22 5b 2d 45 5d 20 5b |ns = . | "[-E] [|
|00000790| 2d 43 5d 20 5b 2d 50 5d | 20 5b 2d 44 6e 61 6d 65 |-C] [-P]| [-Dname|
|000007a0| 5b 3d 5b 74 65 78 74 5d | 5d 5d 20 5b 2d 55 6e 61 |[=[text]|]] [-Una|
|000007b0| 6d 65 5d 20 5b 2d 49 70 | 61 74 68 5d 20 5b 2d 64 |me] [-Ip|ath] [-d|
|000007c0| 66 69 6c 65 5d 5c 6e 20 | 20 20 20 5c 0d 5b 2d 72 |file]\n | \.[-r|
|000007d0| 70 61 74 68 5d 20 5b 2d | 74 6e 61 6d 65 5d 20 5b |path] [-|tname] [|
|000007e0| 2d 78 5d 20 5b 66 69 6c | 65 73 5d 22 3b 0d 0d 2f |-x] [fil|es]";../|
|000007f0| 2a 0d 20 2a 20 20 4e 6f | 74 65 3a 20 72 74 74 20 |*. * No|te: rtt |
|00000800| 70 72 65 73 65 6e 74 6c | 79 20 64 6f 65 73 20 6e |presentl|y does n|
|00000810| 6f 74 20 70 72 6f 63 65 | 73 73 20 73 79 73 74 65 |ot proce|ss syste|
|00000820| 6d 20 69 6e 63 6c 75 64 | 65 20 66 69 6c 65 73 2e |m includ|e files.|
|00000830| 20 49 66 20 74 68 69 73 | 0d 20 2a 20 20 20 69 73 | If this|. * is|
|00000840| 20 6e 65 65 64 65 64 2c | 20 69 74 20 6d 61 79 20 | needed,| it may |
|00000850| 62 65 20 6e 65 63 65 73 | 73 61 72 79 20 74 6f 20 |be neces|sary to |
|00000860| 61 64 64 20 6f 74 68 65 | 72 20 6f 70 74 69 6f 6e |add othe|r option|
|00000870| 73 20 74 68 61 74 20 73 | 65 74 0d 20 2a 20 20 20 |s that s|et. * |
|00000880| 6d 61 6e 69 66 65 73 74 | 20 63 6f 6e 73 74 61 6e |manifest| constan|
|00000890| 74 73 20 69 6e 20 73 75 | 63 68 20 69 6e 63 6c 75 |ts in su|ch inclu|
|000008a0| 64 65 20 66 69 6c 65 73 | 2e 20 20 53 65 65 20 70 |de files|. See p|
|000008b0| 6d 61 69 6e 2e 63 20 66 | 6f 72 20 74 68 65 0d 20 |main.c f|or the. |
|000008c0| 2a 20 20 20 73 74 61 6e | 64 2d 61 6c 6f 6e 65 20 |* stan|d-alone |
|000008d0| 70 72 65 70 72 6f 63 65 | 73 73 6f 72 20 66 6f 72 |preproce|ssor for|
|000008e0| 20 65 78 61 6d 70 6c 65 | 73 20 6f 66 20 77 68 61 | example|s of wha|
|000008f0| 74 27 73 20 6e 65 65 64 | 65 64 2e 0d 20 2a 2f 0d |t's need|ed.. */.|
|00000900| 0d 63 68 61 72 20 2a 70 | 72 6f 67 6e 61 6d 65 20 |.char *p|rogname |
|00000910| 3d 20 22 72 74 74 22 3b | 0d 63 68 61 72 20 2a 63 |= "rtt";|.char *c|
|00000920| 6f 6d 70 69 6c 65 72 5f | 64 65 66 3b 0d 46 49 4c |ompiler_|def;.FIL|
|00000930| 45 20 2a 6f 75 74 5f 66 | 69 6c 65 3b 0d 63 68 61 |E *out_f|ile;.cha|
|00000940| 72 20 2a 69 6e 63 6c 6e | 61 6d 65 3b 0d 69 6e 74 |r *incln|ame;.int|
|00000950| 20 64 65 66 5f 66 6e 64 | 3b 0d 63 68 61 72 20 2a | def_fnd|;.char *|
|00000960| 6c 61 72 67 65 69 6e 74 | 73 20 3d 20 4e 55 4c 4c |largeint|s = NULL|
|00000970| 3b 0d 0d 69 6e 74 20 69 | 63 6f 6e 78 5f 66 6c 67 |;..int i|conx_flg|
|00000980| 20 3d 20 30 3b 0d 69 6e | 74 20 65 6e 61 62 6c 65 | = 0;.in|t enable|
|00000990| 5f 6f 75 74 20 3d 20 30 | 3b 0d 0d 73 74 61 74 69 |_out = 0|;..stati|
|000009a0| 63 20 63 68 61 72 20 2a | 63 75 72 6c 73 74 5f 6e |c char *|curlst_n|
|000009b0| 6d 20 3d 20 22 72 74 74 | 63 75 72 2e 6c 73 74 22 |m = "rtt|cur.lst"|
|000009c0| 3b 0d 73 74 61 74 69 63 | 20 46 49 4c 45 20 2a 63 |;.static| FILE *c|
|000009d0| 75 72 6c 73 74 3b 0d 73 | 74 61 74 69 63 20 63 68 |urlst;.s|tatic ch|
|000009e0| 61 72 20 2a 63 75 72 5f | 73 72 63 3b 0d 0d 65 78 |ar *cur_|src;..ex|
|000009f0| 74 65 72 6e 20 6c 69 6e | 65 5f 63 6e 74 72 6c 3b |tern lin|e_cntrl;|
|00000a00| 0d 0d 2f 2a 0d 20 2a 20 | 74 64 65 66 6e 6d 20 69 |../*. * |tdefnm i|
|00000a10| 73 20 75 73 65 64 20 74 | 6f 20 63 6f 6e 73 74 72 |s used t|o constr|
|00000a20| 75 63 74 20 61 20 6c 69 | 73 74 20 6f 66 20 69 64 |uct a li|st of id|
|00000a30| 65 6e 74 69 66 69 65 72 | 73 20 74 68 61 74 0d 20 |entifier|s that. |
|00000a40| 2a 20 20 6d 75 73 74 20 | 62 65 20 74 72 65 61 74 |* must |be treat|
|00000a50| 65 64 20 62 79 20 72 74 | 74 20 61 73 20 74 79 70 |ed by rt|t as typ|
|00000a60| 65 64 65 66 20 6e 61 6d | 65 73 2e 0d 20 2a 2f 0d |edef nam|es.. */.|
|00000a70| 73 74 72 75 63 74 20 74 | 64 65 66 6e 6d 20 7b 0d |struct t|defnm {.|
|00000a80| 20 20 20 63 68 61 72 20 | 2a 6e 61 6d 65 3b 0d 20 | char |*name;. |
|00000a90| 20 20 73 74 72 75 63 74 | 20 74 64 65 66 6e 6d 20 | struct| tdefnm |
|00000aa0| 2a 6e 65 78 74 3b 0d 20 | 20 20 7d 3b 0d 0d 73 74 |*next;. | };..st|
|00000ab0| 61 74 69 63 20 63 68 61 | 72 20 2a 64 62 6e 61 6d |atic cha|r *dbnam|
|00000ac0| 65 20 3d 20 22 72 74 2e | 64 62 22 3b 0d 73 74 61 |e = "rt.|db";.sta|
|00000ad0| 74 69 63 20 69 6e 74 20 | 70 70 5f 6f 6e 6c 79 20 |tic int |pp_only |
|00000ae0| 3d 20 30 3b 0d 73 74 61 | 74 69 63 20 63 68 61 72 |= 0;.sta|tic char|
|00000af0| 20 2a 6f 70 74 5f 6c 73 | 74 3b 0d 73 74 61 74 69 | *opt_ls|t;.stati|
|00000b00| 63 20 63 68 61 72 20 2a | 2a 6f 70 74 5f 61 72 67 |c char *|*opt_arg|
|00000b10| 73 3b 0d 73 74 61 74 69 | 63 20 63 68 61 72 20 2a |s;.stati|c char *|
|00000b20| 69 6e 5f 68 65 61 64 65 | 72 3b 0d 73 74 61 74 69 |in_heade|r;.stati|
|00000b30| 63 20 73 74 72 75 63 74 | 20 74 64 65 66 6e 6d 20 |c struct| tdefnm |
|00000b40| 2a 74 64 65 66 6e 6d 5f | 6c 73 74 20 3d 20 4e 55 |*tdefnm_|lst = NU|
|00000b50| 4c 4c 3b 0d 0d 2f 2a 0d | 20 2a 20 67 65 74 6f 70 |LL;../*.| * getop|
|00000b60| 74 28 29 20 76 61 72 69 | 61 62 6c 65 73 0d 20 2a |t() vari|ables. *|
|00000b70| 2f 0d 65 78 74 65 72 6e | 20 69 6e 74 20 6f 70 74 |/.extern| int opt|
|00000b80| 69 6e 64 65 78 3b 09 09 | 2f 2a 20 69 6e 64 65 78 |index;..|/* index|
|00000b90| 20 69 6e 74 6f 20 70 61 | 72 65 6e 74 20 61 72 67 | into pa|rent arg|
|00000ba0| 76 20 76 65 63 74 6f 72 | 20 2a 2f 0d 65 78 74 65 |v vector| */.exte|
|00000bb0| 72 6e 20 69 6e 74 20 6f | 70 74 6f 70 74 3b 09 09 |rn int o|ptopt;..|
|00000bc0| 2f 2a 20 63 68 61 72 61 | 63 74 65 72 20 63 68 65 |/* chara|cter che|
|00000bd0| 63 6b 65 64 20 66 6f 72 | 20 76 61 6c 69 64 69 74 |cked for| validit|
|00000be0| 79 20 2a 2f 0d 65 78 74 | 65 72 6e 20 63 68 61 72 |y */.ext|ern char|
|00000bf0| 20 2a 6f 70 74 61 72 67 | 3b 09 09 2f 2a 20 61 72 | *optarg|;../* ar|
|00000c00| 67 75 6d 65 6e 74 20 61 | 73 73 6f 63 69 61 74 65 |gument a|ssociate|
|00000c10| 64 20 77 69 74 68 20 6f | 70 74 69 6f 6e 20 2a 2f |d with o|ption */|
|00000c20| 0d 0d 23 69 66 20 54 55 | 52 42 4f 0d 75 6e 73 69 |..#if TU|RBO.unsi|
|00000c30| 67 6e 65 64 20 5f 73 74 | 6b 6c 65 6e 20 3d 20 32 |gned _st|klen = 2|
|00000c40| 30 30 30 30 3b 0d 23 65 | 6e 64 69 66 09 09 09 09 |0000;.#e|ndif....|
|00000c50| 09 2f 2a 20 54 55 52 42 | 4f 20 2a 2f 0d 0d 69 6e |./* TURB|O */..in|
|00000c60| 74 20 6d 61 69 6e 28 61 | 72 67 63 2c 20 61 72 67 |t main(a|rgc, arg|
|00000c70| 76 29 0d 69 6e 74 20 61 | 72 67 63 3b 0d 63 68 61 |v).int a|rgc;.cha|
|00000c80| 72 20 2a 2a 61 72 67 76 | 3b 0d 20 20 20 7b 0d 20 |r **argv|;. {. |
|00000c90| 20 20 69 6e 74 20 63 3b | 0d 20 20 20 69 6e 74 20 | int c;|. int |
|00000ca0| 6e 6f 70 74 73 3b 0d 20 | 20 20 63 68 61 72 20 62 |nopts;. | char b|
|00000cb0| 75 66 5b 4d 61 78 46 69 | 6c 65 4e 61 6d 65 5d 3b |uf[MaxFi|leName];|
|00000cc0| 09 09 2f 2a 20 66 69 6c | 65 20 6e 61 6d 65 20 63 |../* fil|e name c|
|00000cd0| 6f 6e 73 74 72 75 63 74 | 69 6f 6e 20 62 75 66 66 |onstruct|ion buff|
|00000ce0| 65 72 20 2a 2f 0d 20 20 | 20 73 74 72 75 63 74 20 |er */. | struct |
|00000cf0| 66 69 6c 65 70 61 72 74 | 73 20 2a 66 70 3b 0d 0d |filepart|s *fp;..|
|00000d00| 20 20 20 2f 2a 0d 20 20 | 20 20 2a 20 53 65 65 20 | /*. | * See |
|00000d10| 69 66 20 74 68 65 20 6c | 6f 63 61 74 69 6f 6e 20 |if the l|ocation |
|00000d20| 6f 66 20 69 6e 63 6c 75 | 64 65 20 66 69 6c 65 73 |of inclu|de files|
|00000d30| 20 68 61 73 20 62 65 65 | 6e 20 70 61 74 63 68 65 | has bee|n patche|
|00000d40| 64 20 69 6e 74 6f 20 74 | 68 65 0d 20 20 20 20 2a |d into t|he. *|
|00000d50| 20 20 72 74 74 20 65 78 | 65 63 75 74 61 62 6c 65 | rtt ex|ecutable|
|00000d60| 2e 0d 20 20 20 20 2a 2f | 0d 20 20 20 69 66 20 28 |.. */|. if (|
|00000d70| 73 74 72 6c 65 6e 28 70 | 61 74 63 68 70 61 74 68 |strlen(p|atchpath|
|00000d80| 29 3e 31 38 29 0d 20 20 | 20 20 20 20 72 65 66 70 |)>18). | refp|
|00000d90| 61 74 68 20 3d 20 70 61 | 74 63 68 70 61 74 68 2b |ath = pa|tchpath+|
|00000da0| 31 38 3b 0d 0d 20 20 20 | 2f 2a 0d 20 20 20 20 2a |18;.. |/*. *|
|00000db0| 20 49 6e 69 74 69 61 6c | 69 7a 65 20 74 68 65 20 | Initial|ize the |
|00000dc0| 73 74 72 69 6e 67 20 74 | 61 62 6c 65 20 61 6e 64 |string t|able and|
|00000dd0| 20 69 6e 64 69 63 61 74 | 65 20 74 68 61 74 20 46 | indicat|e that F|
|00000de0| 69 6c 65 20 6d 75 73 74 | 20 62 65 20 74 72 65 61 |ile must| be trea|
|00000df0| 74 65 64 0d 20 20 20 20 | 2a 20 20 61 73 20 61 20 |ted. |* as a |
|00000e00| 74 79 70 65 64 65 66 20 | 6e 61 6d 65 2e 0d 20 20 |typedef |name.. |
|00000e10| 20 20 2a 2f 0d 20 20 20 | 69 6e 69 74 5f 73 74 72 | */. |init_str|
|00000e20| 28 29 3b 0d 20 20 20 61 | 64 64 5f 74 64 65 66 28 |();. a|dd_tdef(|
|00000e30| 22 46 49 4c 45 22 29 3b | 0d 0d 20 20 20 2f 2a 0d |"FILE");|.. /*.|
|00000e40| 20 20 20 20 2a 20 42 79 | 20 64 65 66 61 75 6c 74 | * By| default|
|00000e50| 2c 20 74 68 65 20 73 70 | 65 6c 6c 69 6e 67 20 6f |, the sp|elling o|
|00000e60| 66 20 77 68 69 74 65 20 | 73 70 61 63 65 20 69 6e |f white |space in|
|00000e70| 20 75 6e 69 6d 70 6f 72 | 74 61 6e 74 20 28 69 74 | unimpor|tant (it|
|00000e80| 20 63 61 6e 0d 20 20 20 | 20 2a 20 20 6f 6e 6c 79 | can. | * only|
|00000e90| 20 62 65 20 73 69 67 6e | 69 66 69 63 61 6e 74 20 | be sign|ificant |
|00000ea0| 77 69 74 68 20 74 68 65 | 20 2d 45 20 6f 70 74 69 |with the| -E opti|
|00000eb0| 6f 6e 29 20 61 6e 64 20 | 23 6c 69 6e 65 20 64 69 |on) and |#line di|
|00000ec0| 72 65 63 74 69 76 65 73 | 0d 20 20 20 20 2a 20 20 |rectives|. * |
|00000ed0| 61 72 65 20 72 65 71 75 | 69 72 65 64 20 69 6e 20 |are requ|ired in |
|00000ee0| 74 68 65 20 6f 75 74 70 | 75 74 2e 0d 20 20 20 20 |the outp|ut.. |
|00000ef0| 2a 2f 0d 20 20 20 77 68 | 73 70 5f 69 6d 61 67 65 |*/. wh|sp_image|
|00000f00| 20 3d 20 4e 6f 53 70 65 | 6c 6c 69 6e 67 3b 0d 20 | = NoSpe|lling;. |
|00000f10| 20 20 6c 69 6e 65 5f 63 | 6e 74 72 6c 20 3d 20 31 | line_c|ntrl = 1|
|00000f20| 3b 0d 0d 20 20 20 2f 2a | 0d 20 20 20 20 2a 20 6f |;.. /*|. * o|
|00000f30| 70 74 5f 6c 73 74 20 61 | 6e 64 20 6f 70 74 5f 61 |pt_lst a|nd opt_a|
|00000f40| 72 67 73 20 61 72 65 20 | 74 68 65 20 6f 70 74 69 |rgs are |the opti|
|00000f50| 6f 6e 73 20 61 6e 64 20 | 63 6f 72 72 65 73 70 6f |ons and |correspo|
|00000f60| 6e 64 69 6e 67 20 61 72 | 67 75 6d 65 6e 74 73 0d |nding ar|guments.|
|00000f70| 20 20 20 20 2a 20 20 74 | 68 61 74 20 61 72 65 20 | * t|hat are |
|00000f80| 70 61 73 73 65 64 20 61 | 6c 6f 6e 67 20 74 6f 20 |passed a|long to |
|00000f90| 74 68 65 20 70 72 65 70 | 72 6f 63 65 73 73 6f 72 |the prep|rocessor|
|00000fa0| 20 69 6e 69 74 69 61 6c | 69 7a 61 74 69 6f 6e 20 | initial|ization |
|00000fb0| 72 6f 75 74 69 6e 65 2e | 0d 20 20 20 20 2a 20 20 |routine.|. * |
|00000fc0| 54 68 65 69 72 20 6e 75 | 6d 62 65 72 20 69 73 20 |Their nu|mber is |
|00000fd0| 61 74 20 6d 6f 73 74 20 | 74 68 65 20 6e 75 6d 62 |at most |the numb|
|00000fe0| 65 72 20 6f 66 20 61 72 | 67 75 6d 65 6e 74 73 20 |er of ar|guments |
|00000ff0| 74 6f 20 72 74 74 2e 0d | 20 20 20 20 2a 2f 0d 20 |to rtt..| */. |
|00001000| 20 20 6f 70 74 5f 6c 73 | 74 20 3d 20 28 63 68 61 | opt_ls|t = (cha|
|00001010| 72 20 2a 29 61 6c 6c 6f | 63 28 28 75 6e 73 69 67 |r *)allo|c((unsig|
|00001020| 6e 65 64 29 61 72 67 63 | 29 3b 0d 20 20 20 6f 70 |ned)argc|);. op|
|00001030| 74 5f 61 72 67 73 20 3d | 20 28 63 68 61 72 20 2a |t_args =| (char *|
|00001040| 2a 29 61 6c 6c 6f 63 28 | 28 75 6e 73 69 67 6e 65 |*)alloc(|(unsigne|
|00001050| 64 29 28 73 69 7a 65 6f | 66 20 28 63 68 61 72 20 |d)(sizeo|f (char |
|00001060| 2a 29 29 20 2a 20 61 72 | 67 63 29 3b 0d 20 20 20 |*)) * ar|gc);. |
|00001070| 6e 6f 70 74 73 20 3d 20 | 30 3b 0d 0d 20 20 20 2f |nopts = |0;.. /|
|00001080| 2a 0d 20 20 20 20 2a 20 | 50 72 6f 63 65 73 73 20 |*. * |Process |
|00001090| 6f 70 74 69 6f 6e 73 2e | 0d 20 20 20 20 2a 2f 0d |options.|. */.|
|000010a0| 20 20 20 77 68 69 6c 65 | 20 28 28 63 20 3d 20 67 | while| ((c = g|
|000010b0| 65 74 6f 70 74 28 61 72 | 67 63 2c 20 61 72 67 76 |etopt(ar|gc, argv|
|000010c0| 2c 20 6f 73 74 72 29 29 | 20 21 3d 20 45 4f 46 29 |, ostr))| != EOF)|
|000010d0| 0d 20 20 20 20 20 20 73 | 77 69 74 63 68 20 28 63 |. s|witch (c|
|000010e0| 29 20 7b 0d 09 20 63 61 | 73 65 20 27 45 27 3a 20 |) {.. ca|se 'E': |
|000010f0| 2f 2a 20 72 75 6e 20 70 | 72 65 70 72 6f 63 65 73 |/* run p|reproces|
|00001100| 73 6f 72 20 6f 6e 6c 79 | 20 2a 2f 0d 20 20 20 20 |sor only| */. |
|00001110| 20 20 20 20 20 20 20 20 | 70 70 5f 6f 6e 6c 79 20 | |pp_only |
|00001120| 3d 20 31 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |= 1;. | |
|00001130| 20 69 66 20 28 77 68 73 | 70 5f 69 6d 61 67 65 20 | if (whs|p_image |
|00001140| 3d 3d 20 4e 6f 53 70 65 | 6c 6c 69 6e 67 29 0d 20 |== NoSpe|lling). |
|00001150| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 77 68 | | wh|
|00001160| 73 70 5f 69 6d 61 67 65 | 20 3d 20 4e 6f 43 6f 6d |sp_image| = NoCom|
|00001170| 6d 65 6e 74 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |ment;. | |
|00001180| 20 20 62 72 65 61 6b 3b | 0d 20 20 20 20 20 20 20 | break;|. |
|00001190| 20 20 63 61 73 65 20 27 | 43 27 3a 20 20 2f 2a 20 | case '|C': /* |
|000011a0| 72 65 74 61 69 6e 20 73 | 70 65 6c 6c 69 6e 67 20 |retain s|pelling |
|000011b0| 6f 66 20 77 68 69 74 65 | 20 73 70 61 63 65 2c 20 |of white| space, |
|000011c0| 6f 6e 6c 79 20 65 66 66 | 65 63 74 69 76 65 20 77 |only eff|ective w|
|000011d0| 69 74 68 20 2d 45 20 2a | 2f 0d 20 20 20 20 20 20 |ith -E *|/. |
|000011e0| 20 20 20 20 20 20 77 68 | 73 70 5f 69 6d 61 67 65 | wh|sp_image|
|000011f0| 20 3d 20 46 75 6c 6c 49 | 6d 61 67 65 3b 0d 20 20 | = FullI|mage;. |
|00001200| 20 20 20 20 20 20 20 20 | 20 20 62 72 65 61 6b 3b | | break;|
|00001210| 0d 20 20 20 20 20 20 20 | 20 20 20 63 61 73 65 20 |. | case |
|00001220| 27 50 27 3a 20 2f 2a 20 | 64 6f 20 6e 6f 74 20 70 |'P': /* |do not p|
|00001230| 72 6f 64 75 63 65 20 23 | 6c 69 6e 65 20 64 69 72 |roduce #|line dir|
|00001240| 65 63 74 69 76 65 73 20 | 69 6e 20 6f 75 74 70 75 |ectives |in outpu|
|00001250| 74 20 2a 2f 0d 20 20 20 | 20 20 20 20 20 20 20 20 |t */. | |
|00001260| 20 6c 69 6e 65 5f 63 6e | 74 72 6c 20 3d 20 30 3b | line_cn|trl = 0;|
|00001270| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 62 72 65 |. | bre|
|00001280| 61 6b 3b 0d 20 20 20 20 | 20 20 20 20 20 20 63 61 |ak;. | ca|
|00001290| 73 65 20 27 64 27 3a 20 | 2f 2a 20 2d 64 20 6e 61 |se 'd': |/* -d na|
|000012a0| 6d 65 3a 20 6e 61 6d 65 | 20 6f 66 20 64 61 74 61 |me: name| of data|
|000012b0| 20 62 61 73 65 20 2a 2f | 0d 20 20 20 20 20 20 20 | base */|. |
|000012c0| 20 20 20 20 20 64 62 6e | 61 6d 65 20 3d 20 6f 70 | dbn|ame = op|
|000012d0| 74 61 72 67 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |targ;. | |
|000012e0| 20 20 62 72 65 61 6b 3b | 0d 20 20 20 20 20 20 20 | break;|. |
|000012f0| 20 20 63 61 73 65 20 27 | 72 27 3a 20 20 2f 2a 20 | case '|r': /* |
|00001300| 2d 72 20 70 61 74 68 3a | 20 6c 6f 63 61 74 69 6f |-r path:| locatio|
|00001310| 6e 20 6f 66 20 69 6e 63 | 6c 75 64 65 20 66 69 6c |n of inc|lude fil|
|00001320| 65 73 20 2a 2f 0d 20 20 | 20 20 20 20 20 20 20 20 |es */. | |
|00001330| 20 20 72 65 66 70 61 74 | 68 20 3d 20 6f 70 74 61 | refpat|h = opta|
|00001340| 72 67 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |rg;. | |
|00001350| 62 72 65 61 6b 3b 0d 20 | 20 20 20 20 20 20 20 20 |break;. | |
|00001360| 63 61 73 65 20 27 74 27 | 3a 20 20 2f 2a 20 2d 74 |case 't'|: /* -t|
|00001370| 20 69 64 65 6e 74 20 3a | 20 74 72 65 61 74 20 69 | ident :| treat i|
|00001380| 64 65 6e 74 20 61 73 20 | 61 20 74 79 70 65 64 65 |dent as |a typede|
|00001390| 66 20 6e 61 6d 65 20 2a | 2f 0d 20 20 20 20 20 20 |f name *|/. |
|000013a0| 20 20 20 20 20 20 61 64 | 64 5f 74 64 65 66 28 6f | ad|d_tdef(o|
|000013b0| 70 74 61 72 67 29 3b 0d | 20 20 20 20 20 20 20 20 |ptarg);.| |
|000013c0| 20 20 20 20 62 72 65 61 | 6b 3b 0d 20 20 20 20 20 | brea|k;. |
|000013d0| 20 20 20 20 63 61 73 65 | 20 27 78 27 3a 20 20 2f | case| 'x': /|
|000013e0| 2a 20 70 72 6f 64 75 63 | 65 20 63 6f 64 65 20 66 |* produc|e code f|
|000013f0| 6f 72 20 69 6e 74 65 72 | 70 72 65 74 65 72 20 72 |or inter|preter r|
|00001400| 61 74 68 65 72 20 74 68 | 61 6e 20 63 6f 6d 70 69 |ather th|an compi|
|00001410| 6c 65 72 20 2a 2f 0d 20 | 20 20 20 20 20 20 20 20 |ler */. | |
|00001420| 20 20 20 69 63 6f 6e 78 | 5f 66 6c 67 20 3d 20 31 | iconx|_flg = 1|
|00001430| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 62 72 |;. | br|
|00001440| 65 61 6b 3b 0d 20 20 20 | 20 20 20 20 20 20 63 61 |eak;. | ca|
|00001450| 73 65 20 27 44 27 3a 20 | 20 2f 2a 20 64 65 66 69 |se 'D': | /* defi|
|00001460| 6e 65 20 70 72 65 70 72 | 6f 63 65 73 73 6f 72 20 |ne prepr|ocessor |
|00001470| 73 79 6d 62 6f 6c 20 2a | 2f 0d 20 20 20 20 20 20 |symbol *|/. |
|00001480| 20 20 20 63 61 73 65 20 | 27 49 27 3a 20 20 2f 2a | case |'I': /*|
|00001490| 20 70 61 74 68 20 74 6f | 20 73 65 61 72 63 68 20 | path to| search |
|000014a0| 66 6f 72 20 70 72 65 70 | 72 6f 63 65 73 73 6f 72 |for prep|rocessor|
|000014b0| 20 69 6e 63 6c 75 64 65 | 73 20 2a 2f 0d 20 20 20 | include|s */. |
|000014c0| 20 20 20 20 20 20 63 61 | 73 65 20 27 55 27 3a 20 | ca|se 'U': |
|000014d0| 20 2f 2a 20 75 6e 64 65 | 66 69 6e 65 20 70 72 65 | /* unde|fine pre|
|000014e0| 70 72 6f 63 65 73 73 6f | 72 20 73 79 6d 62 6f 6c |processo|r symbol|
|000014f0| 20 2a 2f 0d 0d 20 20 20 | 20 20 20 20 20 20 20 20 | */.. | |
|00001500| 20 2f 2a 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | /*. | |
|00001510| 20 2a 20 53 61 76 65 20 | 74 68 65 73 65 20 6f 70 | * Save |these op|
|00001520| 74 69 6f 6e 73 20 66 6f | 72 20 74 68 65 20 70 72 |tions fo|r the pr|
|00001530| 65 70 72 6f 63 65 73 73 | 6f 72 20 69 6e 69 74 69 |eprocess|or initi|
|00001540| 61 6c 69 7a 61 74 69 6f | 6e 20 72 6f 75 74 69 6e |alizatio|n routin|
|00001550| 65 2e 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |e.. | |
|00001560| 2a 2f 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 6f |*/. | o|
|00001570| 70 74 5f 6c 73 74 5b 6e | 6f 70 74 73 5d 20 3d 20 |pt_lst[n|opts] = |
|00001580| 63 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 6f |c;. | o|
|00001590| 70 74 5f 61 72 67 73 5b | 6e 6f 70 74 73 5d 20 3d |pt_args[|nopts] =|
|000015a0| 20 6f 70 74 61 72 67 3b | 0d 20 20 20 20 20 20 20 | optarg;|. |
|000015b0| 20 20 20 20 20 2b 2b 6e | 6f 70 74 73 3b 0d 20 20 | ++n|opts;. |
|000015c0| 20 20 20 20 20 20 20 20 | 20 20 62 72 65 61 6b 3b | | break;|
|000015d0| 0d 20 20 20 20 20 20 20 | 20 20 64 65 66 61 75 6c |. | defaul|
|000015e0| 74 3a 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 73 |t:. | s|
|000015f0| 68 6f 77 5f 75 73 61 67 | 65 28 29 3b 0d 20 20 20 |how_usag|e();. |
|00001600| 20 20 20 20 20 20 7d 0d | 0d 23 69 66 64 65 66 20 | }.|.#ifdef |
|00001610| 52 74 74 78 0d 20 20 20 | 69 66 20 28 21 69 63 6f |Rttx. |if (!ico|
|00001620| 6e 78 5f 66 6c 67 29 20 | 7b 0d 20 20 20 20 20 20 |nx_flg) |{. |
|00001630| 66 70 72 69 6e 74 66 28 | 73 74 64 6f 75 74 2c 0d |fprintf(|stdout,.|
|00001640| 20 20 20 20 20 20 20 20 | 20 22 72 74 74 20 77 61 | | "rtt wa|
|00001650| 73 20 63 6f 6d 70 69 6c | 65 64 20 74 6f 20 6f 6e |s compil|ed to on|
|00001660| 6c 79 20 73 75 70 70 6f | 72 74 20 74 68 65 20 69 |ly suppo|rt the i|
|00001670| 6e 74 65 70 72 65 74 65 | 72 2c 20 75 73 65 20 2d |nteprete|r, use -|
|00001680| 78 5c 6e 22 29 3b 0d 20 | 20 20 20 20 20 65 78 69 |x\n");. | exi|
|00001690| 74 28 45 72 72 6f 72 45 | 78 69 74 29 3b 0d 20 20 |t(ErrorE|xit);. |
|000016a0| 20 20 20 20 7d 0d 23 65 | 6e 64 69 66 09 09 09 09 | }.#e|ndif....|
|000016b0| 09 2f 2a 20 52 74 74 78 | 20 2a 2f 0d 0d 20 20 20 |./* Rttx| */.. |
|000016c0| 69 66 20 28 69 63 6f 6e | 78 5f 66 6c 67 29 0d 20 |if (icon|x_flg). |
|000016d0| 20 20 20 20 20 63 6f 6d | 70 69 6c 65 72 5f 64 65 | com|piler_de|
|000016e0| 66 20 3d 20 22 23 64 65 | 66 69 6e 65 20 43 4f 4d |f = "#de|fine COM|
|000016f0| 50 49 4c 45 52 20 30 5c | 6e 22 3b 0d 20 20 20 65 |PILER 0\|n";. e|
|00001700| 6c 73 65 0d 20 20 20 20 | 20 20 63 6f 6d 70 69 6c |lse. | compil|
|00001710| 65 72 5f 64 65 66 20 3d | 20 22 23 64 65 66 69 6e |er_def =| "#defin|
|00001720| 65 20 43 4f 4d 50 49 4c | 45 52 20 31 5c 6e 22 3b |e COMPIL|ER 1\n";|
|00001730| 0d 20 20 20 69 6e 5f 68 | 65 61 64 65 72 20 3d 20 |. in_h|eader = |
|00001740| 28 63 68 61 72 20 2a 29 | 61 6c 6c 6f 63 28 28 75 |(char *)|alloc((u|
|00001750| 6e 73 69 67 6e 65 64 29 | 73 74 72 6c 65 6e 28 72 |nsigned)|strlen(r|
|00001760| 65 66 70 61 74 68 29 20 | 2b 0d 20 20 20 20 20 20 |efpath) |+. |
|00001770| 28 75 6e 73 69 67 6e 65 | 64 29 73 74 72 6c 65 6e |(unsigne|d)strlen|
|00001780| 28 67 72 74 74 69 6e 5f | 70 61 74 68 29 20 2b 20 |(grttin_|path) + |
|00001790| 31 29 3b 0d 20 20 20 73 | 74 72 63 70 79 28 69 6e |1);. s|trcpy(in|
|000017a0| 5f 68 65 61 64 65 72 2c | 20 72 65 66 70 61 74 68 |_header,| refpath|
|000017b0| 29 3b 0d 20 20 20 73 74 | 72 63 61 74 28 69 6e 5f |);. st|rcat(in_|
|000017c0| 68 65 61 64 65 72 2c 20 | 67 72 74 74 69 6e 5f 70 |header, |grttin_p|
|000017d0| 61 74 68 29 3b 0d 20 20 | 20 69 6e 63 6c 6e 61 6d |ath);. | inclnam|
|000017e0| 65 20 3d 20 28 63 68 61 | 72 20 2a 29 61 6c 6c 6f |e = (cha|r *)allo|
|000017f0| 63 28 28 75 6e 73 69 67 | 6e 65 64 29 73 74 72 6c |c((unsig|ned)strl|
|00001800| 65 6e 28 72 65 66 70 61 | 74 68 29 20 2b 0d 20 20 |en(refpa|th) +. |
|00001810| 20 20 20 20 28 75 6e 73 | 69 67 6e 65 64 29 73 74 | (uns|igned)st|
|00001820| 72 6c 65 6e 28 72 74 5f | 70 61 74 68 29 20 2b 20 |rlen(rt_|path) + |
|00001830| 31 29 3b 0d 20 20 20 73 | 74 72 63 70 79 28 69 6e |1);. s|trcpy(in|
|00001840| 63 6c 6e 61 6d 65 2c 20 | 72 65 66 70 61 74 68 29 |clname, |refpath)|
|00001850| 3b 0d 20 20 20 73 74 72 | 63 61 74 28 69 6e 63 6c |;. str|cat(incl|
|00001860| 6e 61 6d 65 2c 20 72 74 | 5f 70 61 74 68 29 3b 0d |name, rt|_path);.|
|00001870| 0d 20 20 20 6f 70 74 5f | 6c 73 74 5b 6e 6f 70 74 |. opt_|lst[nopt|
|00001880| 73 5d 20 3d 20 27 5c 30 | 27 3b 0d 0d 20 20 20 2f |s] = '\0|';.. /|
|00001890| 2a 0d 20 20 20 20 2a 20 | 41 74 20 6c 65 61 73 74 |*. * |At least|
|000018a0| 20 6f 6e 65 20 66 69 6c | 65 20 6e 61 6d 65 20 6d | one fil|e name m|
|000018b0| 75 73 74 20 62 65 20 67 | 69 76 65 6e 20 6f 6e 20 |ust be g|iven on |
|000018c0| 74 68 65 20 63 6f 6d 6d | 61 6e 64 20 6c 69 6e 65 |the comm|and line|
|000018d0| 2e 0d 20 20 20 20 2a 2f | 0d 20 20 20 69 66 20 28 |.. */|. if (|
|000018e0| 6f 70 74 69 6e 64 65 78 | 20 3d 3d 20 61 72 67 63 |optindex| == argc|
|000018f0| 29 0d 20 20 20 20 20 73 | 68 6f 77 5f 75 73 61 67 |). s|how_usag|
|00001900| 65 28 29 3b 0d 0d 20 20 | 20 2f 2a 0d 20 20 20 20 |e();.. | /*. |
|00001910| 2a 20 57 68 65 6e 20 63 | 72 65 61 74 69 6e 67 20 |* When c|reating |
|00001920| 74 68 65 20 63 6f 6d 70 | 69 6c 65 72 20 72 75 6e |the comp|iler run|
|00001930| 2d 74 69 6d 65 20 73 79 | 73 74 65 6d 2c 20 72 74 |-time sy|stem, rt|
|00001940| 74 20 6f 75 74 70 75 74 | 73 20 61 20 6c 69 73 74 |t output|s a list|
|00001950| 0d 20 20 20 20 2a 20 20 | 6f 66 20 6e 61 6d 65 73 |. * |of names|
|00001960| 20 6f 66 20 43 20 66 69 | 6c 65 73 20 63 72 65 61 | of C fi|les crea|
|00001970| 74 65 64 2c 20 62 65 63 | 61 75 73 65 20 6d 6f 73 |ted, bec|ause mos|
|00001980| 74 20 6f 66 20 74 68 65 | 20 66 69 6c 65 20 6e 61 |t of the| file na|
|00001990| 6d 65 73 20 61 72 65 0d | 20 20 20 20 2a 20 20 6e |mes are.| * n|
|000019a0| 6f 74 20 64 65 72 69 76 | 65 64 20 66 72 6f 6d 20 |ot deriv|ed from |
|000019b0| 74 68 65 20 6e 61 6d 65 | 73 20 6f 66 20 74 68 65 |the name|s of the|
|000019c0| 20 69 6e 70 75 74 20 66 | 69 6c 65 73 2e 0d 20 20 | input f|iles.. |
|000019d0| 20 20 2a 2f 0d 20 20 20 | 69 66 20 28 21 69 63 6f | */. |if (!ico|
|000019e0| 6e 78 5f 66 6c 67 29 20 | 7b 0d 20 20 20 20 20 20 |nx_flg) |{. |
|000019f0| 63 75 72 6c 73 74 20 3d | 20 66 6f 70 65 6e 28 63 |curlst =| fopen(c|
|00001a00| 75 72 6c 73 74 5f 6e 6d | 2c 20 22 77 22 29 3b 0d |urlst_nm|, "w");.|
|00001a10| 20 20 20 20 20 20 69 66 | 20 28 63 75 72 6c 73 74 | if| (curlst|
|00001a20| 20 3d 3d 20 4e 55 4c 4c | 29 0d 20 20 20 20 20 20 | == NULL|). |
|00001a30| 20 20 20 65 72 72 32 28 | 22 63 61 6e 6e 6f 74 20 | err2(|"cannot |
|00001a40| 6f 70 65 6e 20 22 2c 20 | 63 75 72 6c 73 74 5f 6e |open ", |curlst_n|
|00001a50| 6d 29 3b 0d 20 20 20 20 | 20 20 7d 0d 0d 20 20 20 |m);. | }.. |
|00001a60| 2f 2a 0d 20 20 20 20 2a | 20 55 6e 6c 65 73 73 20 |/*. *| Unless |
|00001a70| 74 68 65 20 69 6e 70 75 | 74 20 69 73 20 6f 6e 6c |the inpu|t is onl|
|00001a80| 79 20 62 65 69 6e 67 20 | 70 72 65 70 72 6f 63 65 |y being |preproce|
|00001a90| 73 73 65 64 2c 20 73 65 | 74 20 75 70 20 74 68 65 |ssed, se|t up the|
|00001aa0| 20 69 6e 2d 6d 65 6d 6f | 72 79 20 64 61 74 61 0d | in-memo|ry data.|
|00001ab0| 20 20 20 20 2a 20 20 62 | 61 73 65 20 28 70 6f 73 | * b|ase (pos|
|00001ac0| 73 69 62 6c 79 20 6c 6f | 61 64 69 6e 67 20 69 74 |sibly lo|ading it|
|00001ad0| 20 66 72 6f 6d 20 61 20 | 66 69 6c 65 29 2e 0d 20 | from a |file).. |
|00001ae0| 20 20 20 2a 2f 0d 20 20 | 20 69 66 20 28 21 70 70 | */. | if (!pp|
|00001af0| 5f 6f 6e 6c 79 29 20 7b | 0d 20 20 20 20 20 20 66 |_only) {|. f|
|00001b00| 70 20 3d 20 66 70 61 72 | 73 65 28 64 62 6e 61 6d |p = fpar|se(dbnam|
|00001b10| 65 29 3b 0d 20 20 20 20 | 20 20 69 66 20 28 2a 66 |e);. | if (*f|
|00001b20| 70 2d 3e 65 78 74 20 3d | 3d 20 27 5c 30 27 29 0d |p->ext =|= '\0').|
|00001b30| 20 20 20 20 20 20 20 20 | 20 64 62 6e 61 6d 65 20 | | dbname |
|00001b40| 3d 20 73 61 6c 6c 6f 63 | 28 6d 61 6b 65 6e 61 6d |= salloc|(makenam|
|00001b50| 65 28 62 75 66 2c 20 53 | 6f 75 72 63 65 44 69 72 |e(buf, S|ourceDir|
|00001b60| 2c 20 64 62 6e 61 6d 65 | 2c 20 44 42 53 75 66 66 |, dbname|, DBSuff|
|00001b70| 69 78 29 29 3b 0d 20 20 | 20 20 20 20 65 6c 73 65 |ix));. | else|
|00001b80| 20 69 66 20 28 21 73 6d | 61 74 63 68 28 66 70 2d | if (!sm|atch(fp-|
|00001b90| 3e 65 78 74 2c 20 44 42 | 53 75 66 66 69 78 29 29 |>ext, DB|Suffix))|
|00001ba0| 0d 20 20 20 20 20 20 20 | 20 20 65 72 72 32 28 22 |. | err2("|
|00001bb0| 62 61 64 20 64 61 74 61 | 20 62 61 73 65 20 6e 61 |bad data| base na|
|00001bc0| 6d 65 3a 22 2c 20 64 62 | 6e 61 6d 65 29 3b 0d 20 |me:", db|name);. |
|00001bd0| 20 20 20 20 20 6c 6f 61 | 64 64 62 28 64 62 6e 61 | loa|ddb(dbna|
|00001be0| 6d 65 29 3b 0d 20 20 20 | 20 20 20 7d 0d 0d 20 20 |me);. | }.. |
|00001bf0| 20 2f 2a 0d 20 20 20 20 | 2a 20 53 63 61 6e 20 66 | /*. |* Scan f|
|00001c00| 69 6c 65 20 6e 61 6d 65 | 20 61 72 67 75 6d 65 6e |ile name| argumen|
|00001c10| 74 73 2c 20 61 6e 64 20 | 74 72 61 6e 73 6c 61 74 |ts, and |translat|
|00001c20| 65 20 74 68 65 20 66 69 | 6c 65 73 2e 0d 20 20 20 |e the fi|les.. |
|00001c30| 20 2a 2f 0d 20 20 20 77 | 68 69 6c 65 20 28 6f 70 | */. w|hile (op|
|00001c40| 74 69 6e 64 65 78 20 3c | 20 61 72 67 63 29 20 20 |tindex <| argc) |
|00001c50| 7b 0d 20 20 20 20 20 20 | 74 72 61 6e 73 28 61 72 |{. |trans(ar|
|00001c60| 67 76 5b 6f 70 74 69 6e | 64 65 78 5d 29 3b 0d 20 |gv[optin|dex]);. |
|00001c70| 20 20 20 20 20 6f 70 74 | 69 6e 64 65 78 2b 2b 3b | opt|index++;|
|00001c80| 0d 20 20 20 20 20 20 7d | 0d 0d 20 20 20 2f 2a 0d |. }|.. /*.|
|00001c90| 20 20 20 20 2a 20 55 6e | 6c 65 73 73 20 74 68 65 | * Un|less the|
|00001ca0| 20 75 73 65 72 20 6a 75 | 73 74 20 72 65 71 75 65 | user ju|st reque|
|00001cb0| 73 74 65 64 20 74 68 65 | 20 70 72 65 70 72 6f 63 |sted the| preproc|
|00001cc0| 65 73 73 6f 72 20 62 65 | 20 72 75 6e 2c 20 77 65 |essor be| run, we|
|00001cd0| 0d 20 20 20 20 2a 20 20 | 20 68 61 76 65 20 63 72 |. * | have cr|
|00001ce0| 65 61 74 65 64 20 43 20 | 66 69 6c 65 73 20 61 6e |eated C |files an|
|00001cf0| 64 20 75 70 64 61 74 65 | 64 20 74 68 65 20 69 6e |d update|d the in|
|00001d00| 2d 6d 65 6d 6f 72 79 20 | 64 61 74 61 20 62 61 73 |-memory |data bas|
|00001d10| 65 2e 0d 20 20 20 20 2a | 20 20 20 49 66 20 74 68 |e.. *| If th|
|00001d20| 69 73 20 69 73 20 74 68 | 65 20 63 6f 6d 70 69 6c |is is th|e compil|
|00001d30| 65 72 27 73 20 72 75 6e | 2d 74 69 6d 65 20 73 79 |er's run|-time sy|
|00001d40| 73 74 65 6d 2c 20 77 65 | 20 6d 75 73 74 20 64 75 |stem, we| must du|
|00001d50| 6d 70 0d 20 20 20 20 2a | 20 20 20 74 6f 20 64 61 |mp. *| to da|
|00001d60| 74 61 20 62 61 73 65 20 | 74 6f 20 61 20 66 69 6c |ta base |to a fil|
|00001d70| 65 20 61 6e 64 20 63 72 | 65 61 74 65 20 61 20 6c |e and cr|eate a l|
|00001d80| 69 73 74 20 6f 66 20 61 | 6c 6c 20 6f 75 74 70 75 |ist of a|ll outpu|
|00001d90| 74 20 66 69 6c 65 73 0d | 20 20 20 20 2a 20 20 20 |t files.| * |
|00001da0| 70 72 6f 64 75 63 65 64 | 20 69 6e 20 61 6c 6c 20 |produced| in all |
|00001db0| 72 75 6e 73 20 6f 66 20 | 72 74 74 20 74 68 61 74 |runs of |rtt that|
|00001dc0| 20 63 72 65 61 74 65 64 | 20 74 68 65 20 64 61 74 | created| the dat|
|00001dd0| 61 20 62 61 73 65 2e 0d | 20 20 20 20 2a 2f 0d 20 |a base..| */. |
|00001de0| 20 20 69 66 20 28 21 28 | 70 70 5f 6f 6e 6c 79 20 | if (!(|pp_only |
|00001df0| 7c 7c 20 69 63 6f 6e 78 | 5f 66 6c 67 29 29 20 7b ||| iconx|_flg)) {|
|00001e00| 0d 20 20 20 20 20 20 69 | 66 20 28 66 63 6c 6f 73 |. i|f (fclos|
|00001e10| 65 28 63 75 72 6c 73 74 | 29 20 21 3d 20 30 29 0d |e(curlst|) != 0).|
|00001e20| 20 20 20 20 20 20 20 20 | 20 65 72 72 32 28 22 63 | | err2("c|
|00001e30| 61 6e 6e 6f 74 20 63 6c | 6f 73 65 20 22 2c 20 63 |annot cl|ose ", c|
|00001e40| 75 72 6c 73 74 5f 6e 6d | 29 3b 0d 20 20 20 20 20 |urlst_nm|);. |
|00001e50| 20 64 75 6d 70 64 62 28 | 64 62 6e 61 6d 65 29 3b | dumpdb(|dbname);|
|00001e60| 0d 20 20 20 20 20 20 66 | 75 6c 6c 5f 6c 73 74 28 |. f|ull_lst(|
|00001e70| 22 72 74 74 66 75 6c 6c | 2e 6c 73 74 22 29 3b 0d |"rttfull|.lst");.|
|00001e80| 20 20 20 20 20 20 7d 0d | 20 20 20 72 65 74 75 72 | }.| retur|
|00001e90| 6e 20 4e 6f 72 6d 61 6c | 45 78 69 74 3b 0d 20 20 |n Normal|Exit;. |
|00001ea0| 20 7d 0d 0d 2f 2a 0d 20 | 2a 20 74 72 61 6e 73 20 | }../*. |* trans |
|00001eb0| 2d 20 74 72 61 6e 73 6c | 61 74 65 20 61 20 73 6f |- transl|ate a so|
|00001ec0| 75 72 63 65 20 66 69 6c | 65 2e 0d 20 2a 2f 0d 6e |urce fil|e.. */.n|
|00001ed0| 6f 76 61 6c 75 65 20 74 | 72 61 6e 73 28 73 72 63 |ovalue t|rans(src|
|00001ee0| 5f 66 69 6c 65 29 0d 63 | 68 61 72 20 2a 73 72 63 |_file).c|har *src|
|00001ef0| 5f 66 69 6c 65 3b 0d 20 | 20 20 7b 0d 20 20 20 63 |_file;. | {. c|
|00001f00| 68 61 72 20 2a 63 6e 61 | 6d 65 3b 0d 20 20 20 63 |har *cna|me;. c|
|00001f10| 68 61 72 20 62 75 66 5b | 4d 61 78 46 69 6c 65 4e |har buf[|MaxFileN|
|00001f20| 61 6d 65 5d 3b 09 09 2f | 2a 20 66 69 6c 65 20 6e |ame];../|* file n|
|00001f30| 61 6d 65 20 63 6f 6e 73 | 74 72 75 63 74 69 6f 6e |ame cons|truction|
|00001f40| 20 62 75 66 66 65 72 20 | 2a 2f 0d 20 20 20 63 68 | buffer |*/. ch|
|00001f50| 61 72 20 2a 62 75 66 5f | 70 74 72 3b 0d 20 20 20 |ar *buf_|ptr;. |
|00001f60| 63 68 61 72 20 2a 73 3b | 0d 20 20 20 73 74 72 75 |char *s;|. stru|
|00001f70| 63 74 20 66 69 6c 65 70 | 61 72 74 73 20 2a 66 70 |ct filep|arts *fp|
|00001f80| 3b 0d 20 20 20 73 74 72 | 75 63 74 20 74 64 65 66 |;. str|uct tdef|
|00001f90| 6e 6d 20 2a 74 64 3b 0d | 20 20 20 73 74 72 75 63 |nm *td;.| struc|
|00001fa0| 74 20 74 6f 6b 65 6e 20 | 2a 74 3b 0d 20 20 20 73 |t token |*t;. s|
|00001fb0| 74 61 74 69 63 20 63 68 | 61 72 20 2a 73 74 61 6e |tatic ch|ar *stan|
|00001fc0| 64 61 72 64 70 70 20 3d | 20 22 23 64 65 66 69 6e |dardpp =| "#defin|
|00001fd0| 65 20 53 74 61 6e 64 61 | 72 64 50 50 5c 6e 22 3b |e Standa|rdPP\n";|
|00001fe0| 0d 20 20 20 73 74 61 74 | 69 63 20 63 68 61 72 20 |. stat|ic char |
|00001ff0| 2a 74 65 73 74 5f 6c 61 | 72 67 65 69 6e 74 73 20 |*test_la|rgeints |
|00002000| 3d 20 22 23 69 66 64 65 | 66 20 4c 61 72 67 65 49 |= "#ifde|f LargeI|
|00002010| 6e 74 73 5c 6e 79 65 73 | 5c 6e 23 65 6e 64 69 66 |nts\nyes|\n#endif|
|00002020| 5c 6e 22 3b 0d 20 20 20 | 73 74 61 74 69 63 20 66 |\n";. |static f|
|00002030| 69 72 73 74 5f 74 69 6d | 65 20 3d 20 31 3b 0d 0d |irst_tim|e = 1;..|
|00002040| 20 20 20 63 75 72 5f 73 | 72 63 20 3d 20 73 72 63 | cur_s|rc = src|
|00002050| 5f 66 69 6c 65 3b 0d 0d | 20 20 20 2f 2a 0d 20 20 |_file;..| /*. |
|00002060| 20 20 2a 20 52 65 61 64 | 20 73 74 61 6e 64 61 72 | * Read| standar|
|00002070| 64 20 68 65 61 64 65 72 | 20 66 69 6c 65 20 66 6f |d header| file fo|
|00002080| 72 20 70 72 65 70 72 6f | 63 65 73 73 6f 72 20 64 |r prepro|cessor d|
|00002090| 69 72 65 63 74 69 76 65 | 73 20 61 6e 64 0d 20 20 |irective|s and. |
|000020a0| 20 20 2a 20 74 79 70 65 | 64 65 66 73 2c 20 62 75 | * type|defs, bu|
|000020b0| 74 20 64 6f 6e 27 74 20 | 77 72 69 74 65 20 61 6e |t don't |write an|
|000020c0| 79 74 68 69 6e 67 20 74 | 6f 20 6f 75 74 70 75 74 |ything t|o output|
|000020d0| 2e 0d 20 20 20 20 2a 2f | 0d 20 20 20 65 6e 61 62 |.. */|. enab|
|000020e0| 6c 65 5f 6f 75 74 20 3d | 20 30 3b 0d 20 20 20 69 |le_out =| 0;. i|
|000020f0| 6e 69 74 5f 70 72 65 70 | 72 6f 63 28 69 6e 5f 68 |nit_prep|roc(in_h|
|00002100| 65 61 64 65 72 2c 20 6f | 70 74 5f 6c 73 74 2c 20 |eader, o|pt_lst, |
|00002110| 6f 70 74 5f 61 72 67 73 | 29 3b 0d 20 20 20 73 74 |opt_args|);. st|
|00002120| 72 5f 73 72 63 28 22 3c | 72 74 74 20 69 6e 69 74 |r_src("<|rtt init|
|00002130| 69 61 6c 69 7a 61 74 69 | 6f 6e 3e 22 2c 20 73 74 |ializati|on>", st|
|00002140| 61 6e 64 61 72 64 70 70 | 2c 20 28 69 6e 74 29 73 |andardpp|, (int)s|
|00002150| 74 72 6c 65 6e 28 73 74 | 61 6e 64 61 72 64 70 70 |trlen(st|andardpp|
|00002160| 29 29 3b 0d 20 20 20 73 | 74 72 5f 73 72 63 28 22 |));. s|tr_src("|
|00002170| 3c 72 74 74 20 69 6e 69 | 74 69 61 6c 69 7a 61 74 |<rtt ini|tializat|
|00002180| 69 6f 6e 3e 22 2c 20 63 | 6f 6d 70 69 6c 65 72 5f |ion>", c|ompiler_|
|00002190| 64 65 66 2c 20 28 69 6e | 74 29 73 74 72 6c 65 6e |def, (in|t)strlen|
|000021a0| 28 63 6f 6d 70 69 6c 65 | 72 5f 64 65 66 29 29 3b |(compile|r_def));|
|000021b0| 0d 20 20 20 69 6e 69 74 | 5f 73 79 6d 28 29 3b 0d |. init|_sym();.|
|000021c0| 20 20 20 66 6f 72 20 28 | 74 64 20 3d 20 74 64 65 | for (|td = tde|
|000021d0| 66 6e 6d 5f 6c 73 74 3b | 20 74 64 20 21 3d 20 4e |fnm_lst;| td != N|
|000021e0| 55 4c 4c 3b 20 74 64 20 | 3d 20 74 64 2d 3e 6e 65 |ULL; td |= td->ne|
|000021f0| 78 74 29 0d 20 20 20 20 | 20 20 73 79 6d 5f 61 64 |xt). | sym_ad|
|00002200| 64 28 54 79 70 65 44 65 | 66 4e 61 6d 65 2c 20 74 |d(TypeDe|fName, t|
|00002210| 64 2d 3e 6e 61 6d 65 2c | 20 4f 74 68 65 72 44 63 |d->name,| OtherDc|
|00002220| 6c 2c 20 31 29 3b 0d 20 | 20 20 69 6e 69 74 5f 6c |l, 1);. | init_l|
|00002230| 65 78 28 29 3b 0d 20 20 | 20 79 79 70 61 72 73 65 |ex();. | yyparse|
|00002240| 28 29 3b 0d 20 20 20 69 | 66 20 28 66 69 72 73 74 |();. i|f (first|
|00002250| 5f 74 69 6d 65 29 20 7b | 0d 20 20 20 20 20 20 66 |_time) {|. f|
|00002260| 69 72 73 74 5f 74 69 6d | 65 20 3d 20 30 3b 0d 20 |irst_tim|e = 0;. |
|00002270| 20 20 20 20 20 2f 2a 0d | 20 20 20 20 20 20 20 2a | /*.| *|
|00002280| 20 4e 6f 77 20 74 68 61 | 74 20 74 68 65 20 73 74 | Now tha|t the st|
|00002290| 61 6e 64 61 72 64 20 69 | 6e 63 6c 75 64 65 20 66 |andard i|nclude f|
|000022a0| 69 6c 65 73 20 68 61 76 | 65 20 62 65 65 6e 20 70 |iles hav|e been p|
|000022b0| 72 6f 63 65 73 73 65 64 | 2c 20 73 65 65 20 69 66 |rocessed|, see if|
|000022c0| 0d 20 20 20 20 20 20 20 | 2a 20 20 4c 61 72 67 65 |. |* Large|
|000022d0| 69 6e 74 73 20 69 73 20 | 64 65 66 69 6e 65 64 20 |ints is |defined |
|000022e0| 61 6e 64 20 6d 61 6b 65 | 20 73 75 72 65 20 69 74 |and make| sure it|
|000022f0| 20 6d 61 74 63 68 65 73 | 20 77 68 61 74 27 73 20 | matches| what's |
|00002300| 69 6e 20 74 68 65 20 64 | 61 74 61 20 62 61 73 65 |in the d|ata base|
|00002310| 2e 0d 20 20 20 20 20 20 | 20 2a 2f 0d 20 20 20 20 |.. | */. |
|00002320| 20 20 73 20 3d 20 22 4e | 6f 4c 61 72 67 65 49 6e | s = "N|oLargeIn|
|00002330| 74 73 22 3b 0d 20 20 20 | 20 20 20 73 74 72 5f 73 |ts";. | str_s|
|00002340| 72 63 28 22 3c 72 74 74 | 20 69 6e 69 74 69 61 6c |rc("<rtt| initial|
|00002350| 69 7a 61 74 69 6f 6e 3e | 22 2c 20 74 65 73 74 5f |ization>|", test_|
|00002360| 6c 61 72 67 65 69 6e 74 | 73 2c 0d 20 20 20 20 20 |largeint|s,. |
|00002370| 20 20 20 20 28 69 6e 74 | 29 73 74 72 6c 65 6e 28 | (int|)strlen(|
|00002380| 74 65 73 74 5f 6c 61 72 | 67 65 69 6e 74 73 29 29 |test_lar|geints))|
|00002390| 3b 0d 20 20 20 20 20 20 | 77 68 69 6c 65 20 28 28 |;. |while ((|
|000023a0| 74 20 3d 20 70 72 65 70 | 72 6f 63 28 29 29 20 21 |t = prep|roc()) !|
|000023b0| 3d 20 4e 55 4c 4c 29 0d | 20 20 20 20 20 20 20 20 |= NULL).| |
|000023c0| 20 20 69 66 20 28 73 74 | 72 63 6d 70 28 74 2d 3e | if (st|rcmp(t->|
|000023d0| 69 6d 61 67 65 2c 20 22 | 79 65 73 22 29 29 0d 20 |image, "|yes")). |
|000023e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 73 20 3d 20 | | s = |
|000023f0| 22 4c 61 72 67 65 49 6e | 74 73 22 3b 0d 20 20 20 |"LargeIn|ts";. |
|00002400| 20 20 20 69 66 20 28 6c | 61 72 67 65 69 6e 74 73 | if (l|argeints|
|00002410| 20 3d 3d 20 4e 55 4c 4c | 29 20 0d 20 20 20 20 20 | == NULL|) . |
|00002420| 20 20 20 20 6c 61 72 67 | 65 69 6e 74 73 20 3d 20 | larg|eints = |
|00002430| 73 3b 0d 20 20 20 20 20 | 20 65 6c 73 65 20 69 66 |s;. | else if|
|00002440| 20 28 73 74 72 63 6d 70 | 28 6c 61 72 67 65 69 6e | (strcmp|(largein|
|00002450| 74 73 2c 20 73 29 20 21 | 3d 20 30 29 0d 20 20 20 |ts, s) !|= 0). |
|00002460| 20 20 20 20 20 20 65 72 | 72 32 28 22 68 65 61 64 | er|r2("head|
|00002470| 65 72 20 66 69 6c 65 20 | 64 65 66 69 6e 69 74 69 |er file |definiti|
|00002480| 6f 6e 20 6f 66 20 4c 61 | 72 67 65 49 6e 74 73 2f |on of La|rgeInts/|
|00002490| 4e 6f 4c 61 72 67 65 49 | 6e 74 73 20 64 6f 65 73 |NoLargeI|nts does|
|000024a0| 20 6e 6f 74 20 6d 61 74 | 63 68 20 22 2c 0d 20 20 | not mat|ch ",. |
|000024b0| 20 20 20 20 20 20 20 20 | 20 20 64 62 6e 61 6d 65 | | dbname|
|000024c0| 29 3b 0d 20 20 20 20 20 | 20 7d 0d 20 20 20 65 6e |);. | }. en|
|000024d0| 61 62 6c 65 5f 6f 75 74 | 20 3d 20 31 3b 0d 0d 20 |able_out| = 1;.. |
|000024e0| 20 20 2f 2a 0d 20 20 20 | 20 2a 20 4d 61 6b 65 20 | /*. | * Make |
|000024f0| 73 75 72 65 20 77 65 20 | 68 61 76 65 20 61 20 2e |sure we |have a .|
|00002500| 72 20 66 69 6c 65 20 6f | 72 20 73 74 61 6e 64 61 |r file o|r standa|
|00002510| 72 64 20 69 6e 70 75 74 | 2e 0d 20 20 20 20 2a 2f |rd input|.. */|
|00002520| 0d 20 20 20 69 66 20 28 | 73 74 72 63 6d 70 28 63 |. if (|strcmp(c|
|00002530| 75 72 5f 73 72 63 2c 20 | 22 2d 22 29 20 3d 3d 20 |ur_src, |"-") == |
|00002540| 30 29 20 7b 0d 20 20 20 | 20 20 20 73 6f 75 72 63 |0) {. | sourc|
|00002550| 65 28 22 2d 22 29 3b 20 | 2f 2a 20 74 65 6c 6c 20 |e("-"); |/* tell |
|00002560| 70 72 65 70 72 6f 63 65 | 73 73 6f 72 20 74 6f 20 |preproce|ssor to |
|00002570| 72 65 61 64 20 73 74 61 | 6e 64 61 72 64 20 69 6e |read sta|ndard in|
|00002580| 70 75 74 20 2a 2f 0d 20 | 20 20 20 20 20 63 6e 61 |put */. | cna|
|00002590| 6d 65 20 3d 20 73 61 6c | 6c 6f 63 28 6d 61 6b 65 |me = sal|loc(make|
|000025a0| 6e 61 6d 65 28 62 75 66 | 2c 20 54 61 72 67 65 74 |name(buf|, Target|
|000025b0| 44 69 72 2c 20 22 73 74 | 64 69 6e 22 2c 20 43 53 |Dir, "st|din", CS|
|000025c0| 75 66 66 69 78 29 29 3b | 0d 20 20 20 20 20 20 7d |uffix));|. }|
|000025d0| 0d 20 20 20 65 6c 73 65 | 20 7b 0d 20 20 20 20 20 |. else| {. |
|000025e0| 20 66 70 20 3d 20 66 70 | 61 72 73 65 28 63 75 72 | fp = fp|arse(cur|
|000025f0| 5f 73 72 63 29 3b 0d 20 | 20 20 20 20 20 69 66 20 |_src);. | if |
|00002600| 28 2a 66 70 2d 3e 65 78 | 74 20 3d 3d 20 27 5c 30 |(*fp->ex|t == '\0|
|00002610| 27 29 0d 20 20 20 20 20 | 20 20 20 20 63 75 72 5f |'). | cur_|
|00002620| 73 72 63 20 3d 20 73 61 | 6c 6c 6f 63 28 6d 61 6b |src = sa|lloc(mak|
|00002630| 65 6e 61 6d 65 28 62 75 | 66 2c 20 53 6f 75 72 63 |ename(bu|f, Sourc|
|00002640| 65 44 69 72 2c 20 63 75 | 72 5f 73 72 63 2c 20 52 |eDir, cu|r_src, R|
|00002650| 74 74 53 75 66 66 69 78 | 29 29 3b 0d 20 20 20 20 |ttSuffix|));. |
|00002660| 20 20 65 6c 73 65 20 69 | 66 20 28 73 74 72 63 6d | else i|f (strcm|
|00002670| 70 28 66 70 2d 3e 65 78 | 74 2c 20 52 74 74 53 75 |p(fp->ex|t, RttSu|
|00002680| 66 66 69 78 29 20 21 3d | 20 30 29 0d 20 20 20 20 |ffix) !=| 0). |
|00002690| 20 20 20 20 20 65 72 72 | 32 28 22 75 6e 6b 6e 6f | err|2("unkno|
|000026a0| 77 6e 20 66 69 6c 65 20 | 73 75 66 66 69 78 20 22 |wn file |suffix "|
|000026b0| 2c 20 63 75 72 5f 73 72 | 63 29 3b 0d 20 20 20 20 |, cur_sr|c);. |
|000026c0| 20 20 63 75 72 5f 73 72 | 63 20 3d 20 73 70 65 63 | cur_sr|c = spec|
|000026d0| 5f 73 74 72 28 63 75 72 | 5f 73 72 63 29 3b 0d 0d |_str(cur|_src);..|
|000026e0| 20 20 20 20 20 20 2f 2a | 0d 20 20 20 20 20 20 20 | /*|. |
|000026f0| 2a 20 46 6f 72 20 74 68 | 65 20 63 6f 6d 70 69 6c |* For th|e compil|
|00002700| 65 72 2c 20 72 65 6d 6f | 76 65 20 66 72 6f 6d 20 |er, remo|ve from |
|00002710| 74 68 65 20 64 61 74 61 | 20 62 61 73 65 20 74 68 |the data| base th|
|00002720| 65 20 6c 69 73 74 20 6f | 66 0d 20 20 20 20 20 20 |e list o|f. |
|00002730| 20 2a 20 20 66 69 6c 65 | 73 20 70 72 6f 64 75 63 | * file|s produc|
|00002740| 65 64 20 66 72 6f 6d 20 | 74 68 69 73 20 69 6e 70 |ed from |this inp|
|00002750| 75 74 20 66 69 6c 65 2e | 0d 20 20 20 20 20 20 20 |ut file.|. |
|00002760| 2a 2f 0d 20 20 20 20 20 | 20 69 66 20 28 21 69 63 |*/. | if (!ic|
|00002770| 6f 6e 78 5f 66 6c 67 29 | 0d 20 20 20 20 20 20 20 |onx_flg)|. |
|00002780| 20 20 63 6c 72 5f 64 70 | 6e 64 28 63 75 72 5f 73 | clr_dp|nd(cur_s|
|00002790| 72 63 29 3b 0d 20 20 20 | 20 20 20 73 6f 75 72 63 |rc);. | sourc|
|000027a0| 65 28 63 75 72 5f 73 72 | 63 29 3b 20 20 2f 2a 20 |e(cur_sr|c); /* |
|000027b0| 74 65 6c 6c 20 70 72 65 | 70 72 6f 63 65 73 73 6f |tell pre|processo|
|000027c0| 72 20 74 6f 20 72 65 61 | 64 20 73 6f 75 72 63 65 |r to rea|d source|
|000027d0| 20 66 69 6c 65 20 2a 2f | 0d 20 20 20 20 20 20 2f | file */|. /|
|000027e0| 2a 0d 20 20 20 20 20 20 | 20 2a 20 46 6f 72 20 74 |*. | * For t|
|000027f0| 68 65 20 69 6e 74 65 72 | 70 72 65 74 65 72 20 70 |he inter|preter p|
|00002800| 72 65 70 65 6e 64 20 22 | 78 22 20 74 6f 20 74 68 |repend "|x" to th|
|00002810| 65 20 66 69 6c 65 20 6e | 61 6d 65 20 66 6f 72 20 |e file n|ame for |
|00002820| 74 68 65 20 2e 63 20 66 | 69 6c 65 2e 0d 20 20 20 |the .c f|ile.. |
|00002830| 20 20 20 20 2a 2f 0d 20 | 20 20 20 20 20 62 75 66 | */. | buf|
|00002840| 5f 70 74 72 20 3d 20 62 | 75 66 3b 0d 20 20 20 20 |_ptr = b|uf;. |
|00002850| 20 20 69 66 20 28 69 63 | 6f 6e 78 5f 66 6c 67 29 | if (ic|onx_flg)|
|00002860| 0d 20 20 20 20 20 20 20 | 20 20 2a 62 75 66 5f 70 |. | *buf_p|
|00002870| 74 72 2b 2b 20 3d 20 27 | 78 27 3b 0d 20 20 20 20 |tr++ = '|x';. |
|00002880| 20 20 6d 61 6b 65 6e 61 | 6d 65 28 62 75 66 5f 70 | makena|me(buf_p|
|00002890| 74 72 2c 20 54 61 72 67 | 65 74 44 69 72 2c 20 63 |tr, Targ|etDir, c|
|000028a0| 75 72 5f 73 72 63 2c 20 | 43 53 75 66 66 69 78 29 |ur_src, |CSuffix)|
|000028b0| 3b 0d 20 20 20 20 20 20 | 63 6e 61 6d 65 20 3d 20 |;. |cname = |
|000028c0| 73 61 6c 6c 6f 63 28 62 | 75 66 29 3b 0d 20 20 20 |salloc(b|uf);. |
|000028d0| 20 20 20 7d 0d 0d 20 20 | 20 69 66 20 28 70 70 5f | }.. | if (pp_|
|000028e0| 6f 6e 6c 79 29 0d 20 20 | 20 20 20 20 6f 75 74 70 |only). | outp|
|000028f0| 75 74 28 73 74 64 6f 75 | 74 29 3b 20 2f 2a 20 69 |ut(stdou|t); /* i|
|00002900| 6e 76 6f 6b 65 20 73 74 | 61 6e 64 61 72 64 20 70 |nvoke st|andard p|
|00002910| 72 65 70 72 6f 63 65 73 | 73 6f 72 20 6f 75 74 70 |reproces|sor outp|
|00002920| 75 74 20 72 6f 75 74 69 | 6e 65 20 2a 2f 0d 20 20 |ut routi|ne */. |
|00002930| 20 65 6c 73 65 20 7b 0d | 20 20 20 20 20 20 2f 2a | else {.| /*|
|00002940| 0d 20 20 20 20 20 20 20 | 2a 20 46 6f 72 20 74 68 |. |* For th|
|00002950| 65 20 63 6f 6d 70 69 6c | 65 72 2c 20 6e 6f 6e 2d |e compil|er, non-|
|00002960| 52 54 4c 20 63 6f 64 65 | 20 69 73 20 70 75 74 20 |RTL code| is put |
|00002970| 69 6e 20 61 20 66 69 6c | 65 20 77 68 6f 73 65 20 |in a fil|e whose |
|00002980| 6e 61 6d 65 0d 20 20 20 | 20 20 20 20 2a 20 20 69 |name. | * i|
|00002990| 73 20 64 65 72 69 76 65 | 64 20 66 72 6f 6d 20 69 |s derive|d from i|
|000029a0| 6e 70 75 74 20 66 69 6c | 65 20 6e 61 6d 65 2e 20 |nput fil|e name. |
|000029b0| 54 68 65 20 66 6c 61 67 | 20 64 65 66 5f 66 6e 64 |The flag| def_fnd|
|000029c0| 20 69 6e 64 69 63 61 74 | 65 73 0d 20 20 20 20 20 | indicat|es. |
|000029d0| 20 20 2a 20 20 69 66 20 | 61 6e 79 74 68 69 6e 67 | * if |anything|
|000029e0| 20 69 6e 74 65 72 65 73 | 74 69 6e 67 20 69 73 20 | interes|ting is |
|000029f0| 70 75 74 20 69 6e 20 74 | 68 65 20 66 69 6c 65 2e |put in t|he file.|
|00002a00| 0d 20 20 20 20 20 20 20 | 2a 2f 0d 20 20 20 20 20 |. |*/. |
|00002a10| 20 64 65 66 5f 66 6e 64 | 20 3d 20 30 3b 0d 20 20 | def_fnd| = 0;. |
|00002a20| 20 20 20 20 69 66 20 28 | 28 6f 75 74 5f 66 69 6c | if (|(out_fil|
|00002a30| 65 20 3d 20 66 6f 70 65 | 6e 28 63 6e 61 6d 65 2c |e = fope|n(cname,|
|00002a40| 20 22 77 22 29 29 20 3d | 3d 20 4e 55 4c 4c 29 0d | "w")) =|= NULL).|
|00002a50| 20 20 20 20 20 20 20 20 | 20 65 72 72 32 28 22 63 | | err2("c|
|00002a60| 61 6e 6e 6f 74 20 6f 70 | 65 6e 20 6f 75 74 70 75 |annot op|en outpu|
|00002a70| 74 20 66 69 6c 65 20 22 | 2c 20 63 6e 61 6d 65 29 |t file "|, cname)|
|00002a80| 3b 0d 20 20 20 20 20 20 | 65 6c 73 65 0d 20 20 20 |;. |else. |
|00002a90| 20 20 20 20 20 20 61 64 | 64 72 6d 6c 73 74 28 63 | ad|drmlst(c|
|00002aa0| 6e 61 6d 65 29 3b 0d 20 | 20 20 20 20 20 70 72 6f |name);. | pro|
|00002ab0| 6c 6f 67 75 65 28 29 3b | 20 2f 2a 20 6f 75 74 70 |logue();| /* outp|
|00002ac0| 75 74 20 73 74 61 6e 64 | 61 72 64 20 63 6f 6d 6d |ut stand|ard comm|
|00002ad0| 65 6e 74 73 20 61 6e 64 | 20 70 72 65 70 72 6f 63 |ents and| preproc|
|00002ae0| 65 73 73 6f 72 20 64 69 | 72 65 63 74 69 76 65 73 |essor di|rectives|
|00002af0| 20 2a 2f 0d 20 20 20 20 | 20 20 79 79 70 61 72 73 | */. | yypars|
|00002b00| 65 28 29 3b 20 20 2f 2a | 20 74 72 61 6e 73 6c 61 |e(); /*| transla|
|00002b10| 74 65 20 74 68 65 20 69 | 6e 70 75 74 20 2a 2f 0d |te the i|nput */.|
|00002b20| 20 20 20 20 20 20 66 70 | 72 69 6e 74 66 28 6f 75 | fp|rintf(ou|
|00002b30| 74 5f 66 69 6c 65 2c 20 | 22 5c 6e 22 29 3b 0d 20 |t_file, |"\n");. |
|00002b40| 20 20 20 20 20 69 66 20 | 28 66 63 6c 6f 73 65 28 | if |(fclose(|
|00002b50| 6f 75 74 5f 66 69 6c 65 | 29 20 21 3d 20 30 29 0d |out_file|) != 0).|
|00002b60| 20 20 20 20 20 20 20 20 | 20 65 72 72 32 28 22 63 | | err2("c|
|00002b70| 61 6e 6e 6f 74 20 63 6c | 6f 73 65 20 22 2c 20 63 |annot cl|ose ", c|
|00002b80| 6e 61 6d 65 29 3b 0d 0d | 20 20 20 20 20 20 2f 2a |name);..| /*|
|00002b90| 0d 20 20 20 20 20 20 20 | 2a 20 46 6f 72 20 74 68 |. |* For th|
|00002ba0| 65 20 43 6f 6d 70 69 6c | 65 72 2c 20 6e 6f 74 65 |e Compil|er, note|
|00002bb0| 20 74 68 65 20 6e 61 6d | 65 20 6f 66 20 74 68 65 | the nam|e of the|
|00002bc0| 20 22 70 72 69 6d 61 72 | 79 22 20 6f 75 74 70 75 | "primar|y" outpu|
|00002bd0| 74 20 66 69 6c 65 0d 20 | 20 20 20 20 20 20 2a 20 |t file. | * |
|00002be0| 20 69 6e 20 74 68 65 20 | 64 61 74 61 20 62 61 73 | in the |data bas|
|00002bf0| 65 20 61 6e 64 20 6c 69 | 73 74 20 6f 66 20 63 72 |e and li|st of cr|
|00002c00| 65 61 74 65 64 20 66 69 | 6c 65 73 2e 0d 20 20 20 |eated fi|les.. |
|00002c10| 20 20 20 20 2a 2f 0d 20 | 20 20 20 20 20 69 66 20 | */. | if |
|00002c20| 28 21 69 63 6f 6e 78 5f | 66 6c 67 29 0d 20 20 20 |(!iconx_|flg). |
|00002c30| 20 20 20 20 20 20 70 75 | 74 5f 63 5f 66 6c 28 63 | pu|t_c_fl(c|
|00002c40| 6e 61 6d 65 2c 20 64 65 | 66 5f 66 6e 64 29 3b 0d |name, de|f_fnd);.|
|00002c50| 20 20 20 20 20 20 7d 0d | 20 20 20 7d 0d 0d 2f 2a | }.| }../*|
|00002c60| 0d 20 2a 20 61 64 64 5f | 74 64 65 66 20 2d 20 61 |. * add_|tdef - a|
|00002c70| 64 64 20 69 64 65 6e 74 | 69 66 69 65 72 20 74 6f |dd ident|ifier to|
|00002c80| 20 6c 69 73 74 20 6f 66 | 20 74 79 70 65 64 65 66 | list of| typedef|
|00002c90| 20 6e 61 6d 65 73 2e 0d | 20 2a 2f 0d 73 74 61 74 | names..| */.stat|
|00002ca0| 69 63 20 6e 6f 76 61 6c | 75 65 20 61 64 64 5f 74 |ic noval|ue add_t|
|00002cb0| 64 65 66 28 6e 61 6d 65 | 29 0d 63 68 61 72 20 2a |def(name|).char *|
|00002cc0| 6e 61 6d 65 3b 0d 20 20 | 20 7b 0d 20 20 20 73 74 |name;. | {. st|
|00002cd0| 72 75 63 74 20 74 64 65 | 66 6e 6d 20 2a 74 64 3b |ruct tde|fnm *td;|
|00002ce0| 0d 0d 20 20 20 74 64 20 | 3d 20 4e 65 77 53 74 72 |.. td |= NewStr|
|00002cf0| 75 63 74 28 74 64 65 66 | 6e 6d 29 3b 0d 20 20 20 |uct(tdef|nm);. |
|00002d00| 74 64 2d 3e 6e 61 6d 65 | 20 3d 20 73 70 65 63 5f |td->name| = spec_|
|00002d10| 73 74 72 28 6e 61 6d 65 | 29 3b 0d 20 20 20 74 64 |str(name|);. td|
|00002d20| 2d 3e 6e 65 78 74 20 3d | 20 74 64 65 66 6e 6d 5f |->next =| tdefnm_|
|00002d30| 6c 73 74 3b 0d 20 20 20 | 74 64 65 66 6e 6d 5f 6c |lst;. |tdefnm_l|
|00002d40| 73 74 20 3d 20 74 64 3b | 0d 20 20 20 7d 0d 0d 2f |st = td;|. }../|
|00002d50| 2a 0d 20 2a 20 41 64 64 | 20 6e 61 6d 65 20 6f 66 |*. * Add| name of|
|00002d60| 20 66 69 6c 65 20 74 6f | 20 74 68 65 20 6f 75 74 | file to| the out|
|00002d70| 70 75 74 20 6c 69 73 74 | 2c 20 61 6e 64 20 69 66 |put list|, and if|
|00002d80| 20 69 74 20 63 6f 6e 74 | 61 69 6e 73 20 22 69 6e | it cont|ains "in|
|00002d90| 74 65 72 65 73 74 69 6e | 67 22 0d 20 2a 20 20 63 |terestin|g". * c|
|00002da0| 6f 64 65 2c 20 61 64 64 | 20 69 74 20 74 6f 20 74 |ode, add| it to t|
|00002db0| 68 65 20 64 65 70 65 6e | 64 65 6e 63 79 20 6c 69 |he depen|dency li|
|00002dc0| 73 74 20 69 6e 20 74 68 | 65 20 64 61 74 61 20 62 |st in th|e data b|
|00002dd0| 61 73 65 2e 0d 20 2a 2f | 0d 6e 6f 76 61 6c 75 65 |ase.. */|.novalue|
|00002de0| 20 70 75 74 5f 63 5f 66 | 6c 28 66 6e 61 6d 65 2c | put_c_f|l(fname,|
|00002df0| 20 6b 65 65 70 29 0d 63 | 68 61 72 20 2a 66 6e 61 | keep).c|har *fna|
|00002e00| 6d 65 3b 0d 69 6e 74 20 | 6b 65 65 70 3b 0d 20 20 |me;.int |keep;. |
|00002e10| 20 7b 0d 20 20 20 73 74 | 72 75 63 74 20 66 69 6c | {. st|ruct fil|
|00002e20| 65 70 61 72 74 73 20 2a | 66 70 3b 0d 0d 20 20 20 |eparts *|fp;.. |
|00002e30| 66 70 20 3d 20 66 70 61 | 72 73 65 28 66 6e 61 6d |fp = fpa|rse(fnam|
|00002e40| 65 29 3b 0d 20 20 20 66 | 70 72 69 6e 74 66 28 63 |e);. f|printf(c|
|00002e50| 75 72 6c 73 74 2c 20 22 | 25 73 5c 6e 22 2c 20 66 |urlst, "|%s\n", f|
|00002e60| 70 2d 3e 6e 61 6d 65 29 | 3b 0d 20 20 20 69 66 20 |p->name)|;. if |
|00002e70| 28 6b 65 65 70 29 0d 20 | 20 20 20 20 20 61 64 64 |(keep). | add|
|00002e80| 5f 64 70 6e 64 28 73 72 | 63 5f 6c 6b 75 70 28 63 |_dpnd(sr|c_lkup(c|
|00002e90| 75 72 5f 73 72 63 29 2c | 20 66 6e 61 6d 65 29 3b |ur_src),| fname);|
|00002ea0| 0d 20 20 20 7d 0d 0d 2f | 2a 0d 20 2a 20 50 72 69 |. }../|*. * Pri|
|00002eb0| 6e 74 20 61 6e 20 65 72 | 72 6f 72 20 6d 65 73 73 |nt an er|ror mess|
|00002ec0| 61 67 65 20 69 66 20 63 | 61 6c 6c 65 64 20 69 6e |age if c|alled in|
|00002ed0| 63 6f 72 72 65 63 74 6c | 79 2e 0d 20 2a 2f 0d 6e |correctl|y.. */.n|
|00002ee0| 6f 76 61 6c 75 65 20 73 | 68 6f 77 5f 75 73 61 67 |ovalue s|how_usag|
|00002ef0| 65 28 29 0d 20 20 20 7b | 0d 20 20 20 66 70 72 69 |e(). {|. fpri|
|00002f00| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 22 75 73 61 |ntf(stde|rr, "usa|
|00002f10| 67 65 3a 20 25 73 20 25 | 73 5c 6e 22 2c 20 70 72 |ge: %s %|s\n", pr|
|00002f20| 6f 67 6e 61 6d 65 2c 20 | 6f 70 74 69 6f 6e 73 29 |ogname, |options)|
|00002f30| 3b 0d 20 20 20 65 78 69 | 74 28 45 72 72 6f 72 45 |;. exi|t(ErrorE|
|00002f40| 78 69 74 29 3b 0d 20 20 | 20 7d 0d 0d 2f 2a 0d 20 |xit);. | }../*. |
|00002f50| 2a 20 79 79 65 72 72 6f | 72 20 2d 20 65 72 72 6f |* yyerro|r - erro|
|00002f60| 72 20 72 6f 75 74 69 6e | 65 20 63 61 6c 6c 65 64 |r routin|e called|
|00002f70| 20 62 79 20 79 61 63 63 | 2e 0d 20 2a 2f 0d 6e 6f | by yacc|.. */.no|
|00002f80| 76 61 6c 75 65 20 79 79 | 65 72 72 6f 72 28 73 29 |value yy|error(s)|
|00002f90| 0d 63 68 61 72 20 2a 73 | 3b 0d 20 20 20 7b 0d 20 |.char *s|;. {. |
|00002fa0| 20 20 73 74 72 75 63 74 | 20 74 6f 6b 65 6e 20 2a | struct| token *|
|00002fb0| 74 3b 0d 0d 20 20 20 74 | 20 3d 20 79 79 6c 76 61 |t;.. t| = yylva|
|00002fc0| 6c 2e 74 3b 0d 20 20 20 | 69 66 20 28 74 20 3d 3d |l.t;. |if (t ==|
|00002fd0| 20 4e 55 4c 4c 29 0d 20 | 20 20 20 20 20 65 72 72 | NULL). | err|
|00002fe0| 32 28 73 2c 20 22 20 61 | 74 20 65 6e 64 20 6f 66 |2(s, " a|t end of|
|00002ff0| 20 66 69 6c 65 22 29 3b | 0d 20 20 20 65 6c 73 65 | file");|. else|
|00003000| 0d 20 20 20 20 20 20 65 | 72 72 74 31 28 74 2c 20 |. e|rrt1(t, |
|00003010| 73 29 3b 0d 20 20 20 7d | 0d 00 00 00 00 00 00 00 |s);. }|........|
|00003020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003080| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00003090| 00 0c 2f 14 70 00 1f 00 | 1f 00 4e ad 02 d2 4a 1f |../.p...|..N...J.|
|000030a0| 67 12 26 54 70 00 10 13 | 52 40 41 f3 00 00 2d 48 |g.&Tp...|R@A...-H|
|000030b0| 09 72 74 74 6d 61 69 6e | 2e 63 02 00 00 00 54 45 |.rttmain|.c....TE|
|000030c0| 58 54 4d 50 53 20 00 00 | 00 00 00 00 00 00 00 00 |XTMPS ..|........|
|000030d0| 00 00 54 45 58 54 4d 50 | 53 20 00 00 00 00 00 00 |..TEXTMP|S ......|
|000030e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030f0| 00 00 a6 e0 04 ce 00 00 | 2f 99 00 00 01 ac 20 6e |........|/..... n|
|00003100| 00 08 10 80 1d 7c 00 01 | 00 10 4c ee 18 00 ff f4 |.....|..|..L.....|
|00003110| 4e 5e 20 5f 50 4f 4e d0 | 88 49 45 47 45 54 45 4e |N^ _PON.|.IEGETEN|
|00003120| 56 00 00 00 4e fa fd be | 4e 56 00 00 48 e7 03 18 |V...N...|NV..H...|
|00003130| 2e 2e 00 0c 26 6e 00 08 | 70 14 a1 22 28 48 20 0c |....&n..|p.."(H .|
|00003140| 66 0e 42 6d f5 42 70 0c | 2b 40 f5 44 70 00 60 5a |f.Bm.Bp.|+@.Dp.`Z|
|00003150| 59 8f 2f 0b 4e ad 03 da | 2f 07 2f 0b 4e ba f5 26 |Y./.N...|/./.N..&|
|00003160| 2c 00 59 8f 2f 0b 4e ad | 03 d2 4a 86 4f ef 00 10 |,.Y./.N.|..J.O...|
|00003170| 6c 08 20 4c a0 23 70 00 | 60 30 20 54 20 86 20 07 |l. L.#p.|`0 T . .|
|00003180| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 6e 73 2e |...H..Mo|naco.ns.|
|00003190| 0d 20 2a 2f 0d 68 69 64 | 64 65 6e 20 6e 6f 76 61 |. */.hid|den nova|
|000031a0| 6c 75 65 20 61 64 00 06 | 00 04 00 2a 00 03 01 53 |lue ad..|...*...S|
|000031b0| 01 fd 00 a0 00 10 01 53 | 01 bd a6 e1 0a 4e 00 00 |.......S|.....N..|
|000031c0| 05 36 00 00 05 36 00 00 | 04 93 01 00 00 00 00 1e |.6...6..|........|
|000031d0| 00 2a 00 03 01 53 01 fd | 00 a0 00 10 01 53 01 bd |.*...S..|.....S..|
|000031e0| 00 00 04 93 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031f0| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 57 |.....n..|.n...>.W|
|00003200| 1a 60 08 d2 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |.`......|.>..MPSR|
|00003210| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00003220| 03 f0 ff ff 00 00 00 4c | 00 59 19 30 00 00 00 00 |.......L|.Y.0....|
|00003230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+